[SCM] PostGIS branch stable-3.3 updated. 3.3.10-99-g1928f0a1bf
git at osgeo.org
git at osgeo.org
Mon Jul 27 16:41:14 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.3 has been updated
via 1928f0a1bf0b818585a355102f74224698fe3a6a (commit)
via 576de179abca6a601eb37db960e82b6e403c526d (commit)
via 6a0c5aeada44f49ec6cab7190b119cd886757246 (commit)
via 84b3358ade193097c197a96f5772d6b403709721 (commit)
from 0203ccda5302c1f129589b654652767fd71b8bc9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1928f0a1bf0b818585a355102f74224698fe3a6a
Merge: 0203ccda53 576de179ab
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date: Mon Jul 27 16:41:12 2026 -0700
Merge pull request 'Use GEOSSplit for ST_Split on stable 3.3' (!547) from Komzpa/postgis:codex/stsplit-geos315-stable-3.3 into stable-3.3
Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/547
commit 576de179abca6a601eb37db960e82b6e403c526d
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Tue Jul 28 01:24:04 2026 +0400
NEWS: use original ST_Split reference on stable 3.3
diff --git a/NEWS b/NEWS
index c4bd746cbd..60c37d68ac 100644
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ PostGIS 3.3.11
(Regina Obe)
- #6094, [upgrade] Avoid legacy string literal warnings in downgrade checks
with standard_conforming_strings off (Darafei Praliaskouski)
- - GT-547, Fix ST_Split recursion with GEOS 3.15 (Paul Ramsey)
+ - #5916, Fix ST_Split recursion with GEOS 3.15 (Paul Ramsey)
- Flatgeobuf schema mismatch vulnerability (NeuroWinter)
- #5899, pg_upgrade issue for non-standard geography SRID (Paul Ramsey)
- #5916, ST_Split hang with very large ordinates (Paul Ramsey)
commit 6a0c5aeada44f49ec6cab7190b119cd886757246
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Mon Jul 27 05:57:41 2026 +0400
Rerun Woodie after runner network exhaustion
commit 84b3358ade193097c197a96f5772d6b403709721
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Jun 30 12:05:14 2026 -0700
Use GEOSSplit where available for ST_Split
(cherry picked from commit 370c6a160a21d46b0768fb70ea0d75292cc475d0)
diff --git a/NEWS b/NEWS
index 48bd45c034..c4bd746cbd 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ PostGIS 3.3.11
(Regina Obe)
- #6094, [upgrade] Avoid legacy string literal warnings in downgrade checks
with standard_conforming_strings off (Darafei Praliaskouski)
+ - GT-547, Fix ST_Split recursion with GEOS 3.15 (Paul Ramsey)
- Flatgeobuf schema mismatch vulnerability (NeuroWinter)
- #5899, pg_upgrade issue for non-standard geography SRID (Paul Ramsey)
- #5916, ST_Split hang with very large ordinates (Paul Ramsey)
diff --git a/liblwgeom/cunit/cu_wrapx.c b/liblwgeom/cunit/cu_wrapx.c
index a5ca09a285..cde804577e 100644
--- a/liblwgeom/cunit/cu_wrapx.c
+++ b/liblwgeom/cunit/cu_wrapx.c
@@ -83,9 +83,11 @@ static void test_lwgeom_wrapx(void)
lwgeom_free(tmp);
CU_ASSERT_FATAL(ret != NULL);
obt_wkt = lwgeom_to_ewkt(ret);
- tmp = lwgeom_from_wkt(
- "MULTILINESTRING((0 0,8 0),(-2 0,0 0))",
- LW_PARSER_CHECK_NONE);
+#if POSTGIS_GEOS_VERSION < 31500
+ tmp = lwgeom_from_wkt("MULTILINESTRING((0 0,8 0),(-2 0,0 0))", LW_PARSER_CHECK_NONE);
+#else
+ tmp = lwgeom_from_wkt("LINESTRING(-2 0,0 0,8 0)", LW_PARSER_CHECK_NONE);
+#endif
tmp2 = lwgeom_normalize(tmp);
lwgeom_free(tmp);
exp_wkt = lwgeom_to_ewkt(tmp2);
diff --git a/liblwgeom/lwgeom_geos_split.c b/liblwgeom/lwgeom_geos_split.c
index 3dba1d06dd..f8363c966b 100644
--- a/liblwgeom/lwgeom_geos_split.c
+++ b/liblwgeom/lwgeom_geos_split.c
@@ -111,13 +111,23 @@ lwline_split_by_line(const LWLINE* lwline_in, const LWGEOM* blade_in)
return NULL;
}
-
- gdiff = GEOSDifference(g1,g2);
+#if POSTGIS_GEOS_VERSION >= 31500
+ /* GEOS 3.15 added an explicit splitter. Older GEOS relies on the
+ * side-effect of GEOSDifference returning the input split at the
+ * crossing points of the (non-overlapping) blade. */
+ gdiff = GEOSSplit(g1, g2);
+#else
+ gdiff = GEOSDifference(g1, g2);
+#endif
GEOSGeom_destroy(g1);
GEOSGeom_destroy(g2);
if (gdiff == NULL)
{
+#if POSTGIS_GEOS_VERSION >= 31500
+ lwerror("GEOSSplit: %s", lwgeom_geos_errmsg);
+#else
lwerror("GEOSDifference: %s", lwgeom_geos_errmsg);
+#endif
return NULL;
}
@@ -353,6 +363,68 @@ lwline_split(const LWLINE* lwline_in, const LWGEOM* blade_in)
static LWGEOM*
lwpoly_split_by_line(const LWPOLY* lwpoly_in, const LWGEOM* blade_in)
{
+#if POSTGIS_GEOS_VERSION >= 31500
+ /* GEOS 3.15 splits polygons directly, filtering out the pieces that
+ * fall inside holes for us. On older GEOS we reproduce that logic by
+ * polygonizing the boundary unioned with the blade and discarding the
+ * pieces whose point-on-surface is not contained by the input (#else). */
+ LWGEOM *split;
+ LWCOLLECTION *out;
+ GEOSGeometry *g1;
+ GEOSGeometry *g2;
+ GEOSGeometry *gsplit;
+ int hasZ = FLAGS_GET_Z(lwpoly_in->flags);
+
+ initGEOS(lwgeom_geos_error, lwgeom_geos_error);
+
+ g1 = LWGEOM2GEOS((LWGEOM *)lwpoly_in, 0);
+ if (NULL == g1)
+ {
+ lwerror("LWGEOM2GEOS: %s", lwgeom_geos_errmsg);
+ return NULL;
+ }
+
+ g2 = LWGEOM2GEOS(blade_in, 0);
+ if (NULL == g2)
+ {
+ GEOSGeom_destroy(g1);
+ lwerror("LWGEOM2GEOS: %s", lwgeom_geos_errmsg);
+ return NULL;
+ }
+
+ gsplit = GEOSSplit(g1, g2);
+ GEOSGeom_destroy(g1);
+ GEOSGeom_destroy(g2);
+ if (NULL == gsplit)
+ {
+ lwerror("GEOSSplit: %s", lwgeom_geos_errmsg);
+ return NULL;
+ }
+
+ split = GEOS2LWGEOM(gsplit, hasZ);
+ GEOSGeom_destroy(gsplit);
+ if (NULL == split)
+ {
+ lwerror("GEOS2LWGEOM: %s", lwgeom_geos_errmsg);
+ return NULL;
+ }
+
+ /* GEOSSplit always returns a collection, but wrap defensively */
+ out = lwgeom_as_lwcollection(split);
+ if (!out)
+ {
+ LWGEOM **components = lwalloc(sizeof(LWGEOM *));
+ components[0] = split;
+ out = lwcollection_construct(COLLECTIONTYPE, lwpoly_in->srid, NULL, 1, components);
+ }
+ else
+ {
+ lwgeom_set_srid((LWGEOM *)out, lwpoly_in->srid);
+ out->type = COLLECTIONTYPE;
+ }
+
+ return (LWGEOM *)out;
+#else
LWCOLLECTION* out;
GEOSGeometry* g1;
GEOSGeometry* g2;
@@ -491,6 +563,7 @@ lwpoly_split_by_line(const LWPOLY* lwpoly_in, const LWGEOM* blade_in)
GEOSGeom_destroy(polygons);
return (LWGEOM*)out;
+#endif /* POSTGIS_GEOS_VERSION >= 31500 */
}
static LWGEOM*
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
liblwgeom/cunit/cu_wrapx.c | 8 +++--
liblwgeom/lwgeom_geos_split.c | 77 +++++++++++++++++++++++++++++++++++++++++--
3 files changed, 81 insertions(+), 5 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list