libgeos / geos

Geometry Engine, Open Source
https://libgeos.org
GNU Lesser General Public License v2.1
1.18k stars 354 forks source link

Add function to split geometries #1101

Open dbaston opened 4 months ago

dbaston commented 4 months ago

Many applications require the ability to split a geometry by a line. This has been implemented in PostGIS, QGIS, and when using the dateline as a splitting geometry, GDAL. Implementing this functionality in GEOS would allow applications to avoid maintaining their own implementations, and could likely provide better performance by avoiding the limitations of the C API.

dr-jts commented 4 months ago

This has been on the ToDo list for a while. The machinery in OverlayNG should accomodate this, with some reworking.

jorisvandenbossche commented 4 months ago

Shapely also has a custom split() function (https://shapely.readthedocs.io/en/stable/manual.html#shapely.ops.split, https://github.com/shapely/shapely/blob/70fcae0561264f8cc2175e27cf5c0c287af8fcf0/shapely/ops.py#L361-L547), so adding this to GEOS would be welcome!