You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ST_Split (split a geometry by a blade geometry, returning the pieces as a GEOMETRYCOLLECTION) is a common PostGIS function missing from duckdb-spatial.
Important, the bundled GEOS is 3.14.1, and native GEOSSplit only landed in GEOS 3.15, so a native bind is not linkable today. The PostGIS recipe composes the result entirely from primitives duckdb-spatial already ships, so it works on 3.14.1 now, and a native GEOSSplit bind can replace it later behind a version guard once the vcpkg baseline reaches 3.15.
Polygon by line recipe (mirrors PostGIS lwgeom_split in lwgeom_geos_split.c)
flowchart TD
A[target polygon] --> B[ST_Boundary]
C[blade line] --> D[ST_Union of boundary and blade]
B --> D
D --> E[ST_Polygonize rebuild faces]
E --> F[keep faces whose point on surface lies inside the original]
F --> G[GEOMETRYCOLLECTION of pieces]
Loading
Line by point or line recipe, ST_Node of the union then collect the parts, or ST_Difference for simple cases.
Implementer tips
Every primitive above already exists as a registered function and a GeosGeometry wrapper (ST_Boundary, ST_Union, ST_Polygonize, ST_PointOnSurface, ST_Contains, ST_Difference, ST_Node), so a composed ST_Split chains existing wrappers in one Execute with no new GEOS calls.
Return a GEOMETRYCOLLECTION of the pieces, matching PostGIS.
Path B, a thin GEOSSplit_r bind behind #if (GEOS_VERSION_MAJOR > 3) || (GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR >= 15), switched on when the baseline advances.
This is adjacent to the ST_Subdivide work in #719 and #583. Both partition geometries, though split by a blade is distinct, so a shared note on scope may help.
Sharing this as research in case it helps whoever picks it up.
ST_Split (split a geometry by a blade geometry, returning the pieces as a GEOMETRYCOLLECTION) is a common PostGIS function missing from duckdb-spatial.
Important, the bundled GEOS is 3.14.1, and native
GEOSSplitonly landed in GEOS 3.15, so a native bind is not linkable today. The PostGIS recipe composes the result entirely from primitives duckdb-spatial already ships, so it works on 3.14.1 now, and a nativeGEOSSplitbind can replace it later behind a version guard once the vcpkg baseline reaches 3.15.Polygon by line recipe (mirrors PostGIS
lwgeom_splitinlwgeom_geos_split.c)flowchart TD A[target polygon] --> B[ST_Boundary] C[blade line] --> D[ST_Union of boundary and blade] B --> D D --> E[ST_Polygonize rebuild faces] E --> F[keep faces whose point on surface lies inside the original] F --> G[GEOMETRYCOLLECTION of pieces]Line by point or line recipe, ST_Node of the union then collect the parts, or ST_Difference for simple cases.
Implementer tips
GEOSSplit_rbind behind#if (GEOS_VERSION_MAJOR > 3) || (GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR >= 15), switched on when the baseline advances.This is adjacent to the ST_Subdivide work in #719 and #583. Both partition geometries, though split by a blade is distinct, so a shared note on scope may help.
Sharing this as research in case it helps whoever picks it up.