talira

C/C++ computational geometry library behind PostGIS, QGIS, GDAL and Shapely

open sourceLGPL-2.1-or-laterfree

GEOS (Geometry Engine, Open Source) is a C/C++ library for computational geometry on two-dimensional vector geometries, focused on the algorithms GIS software needs. It started as a port of the JTS Topology Suite and implements the OGC Simple Features geometry model: predicates such as intersects, contains and within; operations such as union, buffer, simplify and convex hull; an STR packed R-tree index; and WKT and WKB input and output. PostGIS, QGIS, GDAL and Shapely are built on it. It is a project of OSGeo, run by a Project Steering Committee.

Problems it solves

  • compute intersections, unions and buffers of map geometries in C or C++
  • test whether a point lies inside a polygon in my GIS code
  • a geometry engine to embed for spatial predicates and operations

Features

  • OGC Simple Features geometry model: points, lines, polygons and their multi-part forms
  • spatial predicates such as intersects, touches, within, contains and covers
  • operations such as union, intersection, buffer, simplify, convex hull and polygon assembly
  • STR packed R-tree spatial index and prepared geometries
  • WKT and WKB readers and writers
  • a C API with long-term API and ABI stability, plus a C++ API

Limitations

  • Only the C API is stable across releases; the C++ API may change between versions.1