[SCM] PostGIS branch stable-3.2 updated. 3.2.6-6-g6e8a1c9e6

git at osgeo.org git at osgeo.org
Thu Nov 30 15:40:36 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, stable-3.2 has been updated
       via  6e8a1c9e6b6dcfdb37657a051af089a6e409e165 (commit)
      from  f13a8307696ce1397d6825a5d3c93fee71433949 (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 6e8a1c9e6b6dcfdb37657a051af089a6e409e165
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Nov 30 15:12:02 2023 -0800

    Handling of EMPTY components in PiP check, #5627

diff --git a/NEWS b/NEWS
index f33b68196..04e587501 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Proj 6.1+, and PostgreSQL 14+.
 * Bug Fixes and Enhancements *
  - #5610, Regression fix: Allow Nan and infinity again
           in ST_SetPoint (Regina Obe)
+ - #5627, Handling of EMPTY components in PiP check (Paul Ramsey)
 
 PostGIS 3.2.6
 2023/11/19
diff --git a/postgis/lwgeom_functions_analytic.c b/postgis/lwgeom_functions_analytic.c
index 24fc11794..6fa02c296 100644
--- a/postgis/lwgeom_functions_analytic.c
+++ b/postgis/lwgeom_functions_analytic.c
@@ -936,6 +936,9 @@ int point_in_multipolygon_rtree(RTREE_NODE **root, int polyCount, int *ringCount
 
 	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;
+
 	getPoint2d_p(point->point, 0, &pt);
 	/* assume bbox short-circuit has already been attempted */
 
@@ -1045,6 +1048,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/regress/core/tickets.sql b/regress/core/tickets.sql
index 53cdc6a9d..e1cf15380 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1461,3 +1461,11 @@ SELECT '#5315', ST_Buffer('0106000020E864000001000000010300000001000000050000000
 SELECT '#5320', ST_SimplifyPreserveTopology('0106000020E86400000100000001030000000100000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry, 1);
 
 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 4a869fa87..f9055e9ae 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -462,3 +462,4 @@ ERROR:  Line has no points
 ERROR:  Geometry contains invalid coordinates
 ERROR:  Geometry contains invalid coordinates
 #5378|4269
+#5627|t

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

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


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list