[SCM] PostGIS branch master updated. 3.4.0rc1-824-ge85cd1052

git at osgeo.org git at osgeo.org
Thu Nov 30 14:50:41 PST 2023


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, master has been updated
       via  e85cd10523ac7cd5e9ebe34c45f3317e9a19fe32 (commit)
      from  19f290f2396d156f8398d8a5cea48b4c6c8ee6c8 (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 e85cd10523ac7cd5e9ebe34c45f3317e9a19fe32
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Nov 30 14:50:06 2023 -0800

    Handle EMPTY member of collections in PIP cache, references #5627

diff --git a/postgis/lwgeom_functions_analytic.c b/postgis/lwgeom_functions_analytic.c
index aae248c1c..e1f94b6c9 100644
--- a/postgis/lwgeom_functions_analytic.c
+++ b/postgis/lwgeom_functions_analytic.c
@@ -860,6 +860,9 @@ int point_in_multipolygon(LWMPOLY *mpolygon, LWPOINT *point)
 
 	POSTGIS_DEBUG(2, "point_in_polygon called.");
 
+	/* empty is not within anything */
+	if (lwpoint_is_empty(point)) return -1;
+
 	getPoint2d_p(point->point, 0, &pt);
 	/* assume bbox short-circuit has already been attempted */
 
diff --git a/postgis/lwgeom_rtree.c b/postgis/lwgeom_rtree.c
index 2aabb1dbb..efa2b3523 100644
--- a/postgis/lwgeom_rtree.c
+++ b/postgis/lwgeom_rtree.c
@@ -590,6 +590,9 @@ point_in_multipolygon_rtree(RTREE_NODE **root, int polyCount, int *ringCounts, L
 
 	POSTGIS_DEBUGF(2, "point_in_multipolygon_rtree called for %p %d %p.", root, polyCount, point);
 
+	/* empty is not within anything */
+	if (lwpoint_is_empty(point)) return -1;
+
 	pt = getPoint2d_cp(point->point, 0);
 
 	/* assume bbox short-circuit has already been attempted */
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 8fcc885e3..273695cae 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1509,3 +1509,11 @@ SELECT '#5320', ST_SimplifyPreserveTopology('0106000020E864000001000000010300000
 
 DROP PROCEDURE IF EXISTS p_force_parellel_mode(text);
 SELECT '#5378', ST_SRID( ST_Buffer(ST_GeomFromText('POINT(-94 29.53)', 4269)::geography, 12)::geometry );
+
+SELECT '#5627' AS ticket, bool_and(ST_Intersects(
+    'MULTIPOINT(EMPTY,(-378 574))'::geometry,
+    geom))
+FROM (VALUES
+    ('MULTIPOLYGON(((-357 477,-392 574,-378 574,-357 477)))'::geometry),
+    ('MULTIPOLYGON(((-357 477,-392 574,-378 574,-357 477)))'::geometry))
+    AS geoms(geom);
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 145994491..a701e6d6b 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -468,3 +468,4 @@ ERROR:  Line has no points
 ERROR:  Geometry contains invalid coordinates
 ERROR:  Geometry contains invalid coordinates
 #5378|4269
+#5627|t

-----------------------------------------------------------------------

Summary of changes:
 postgis/lwgeom_functions_analytic.c | 3 +++
 postgis/lwgeom_rtree.c              | 3 +++
 regress/core/tickets.sql            | 8 ++++++++
 regress/core/tickets_expected       | 1 +
 4 files changed, 15 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list