[SCM] PostGIS branch stable-3.4 updated. 3.4.1-14-g503c3778e

git at osgeo.org git at osgeo.org
Mon Dec 4 11:06:51 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.4 has been updated
       via  503c3778e72f54c0de3bf294c08cc9a35b8c4893 (commit)
       via  57ce3c978663355a55e613f6fb02446c22ecb600 (commit)
       via  c1a0c55d70e26f19e534fd70b7cc1c8416b16abe (commit)
       via  f45df01f77442e9e22c431b2d9a8deef7825d799 (commit)
      from  342d74200ff38e00c383068cd4a2387f10eaf981 (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 503c3778e72f54c0de3bf294c08cc9a35b8c4893
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 4 09:47:54 2023 -0800

    News item for #5635

diff --git a/NEWS b/NEWS
index 638592a20..5e750cdde 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
  - #5627, Handling of EMPTY components in PiP check (Paul Ramsey)
  - #5629, Handling EMPTY components in repeated point removal (Paul Ramsey)
  - #5604, Handle distance between collections with empty elements (Paul Ramsey)
+ - #5635, Handle NaN points in ST_Split (Regina Obe)
 
 
 * Bug Fixes and Enhancments *

commit 57ce3c978663355a55e613f6fb02446c22ecb600
Author: Regina Obe <lr at pcorp.us>
Date:   Sun Dec 3 17:09:26 2023 -0500

    Prevent NaN and infinite coordinates
    in input and blade geometries of ST_Split
    References #5635 for PostGIS 3.5.0

diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c
index 900c561e7..8871d781e 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -3403,6 +3403,19 @@ Datum ST_Split(PG_FUNCTION_ARGS)
 	lwgeom_in = lwgeom_from_gserialized(in);
 	lwblade_in = lwgeom_from_gserialized(blade_in);
 
+	if (!lwgeom_isfinite(lwgeom_in))
+	{
+		lwpgerror("Input Geometry contains invalid coordinates");
+		PG_RETURN_NULL();
+	}
+
+	if (!lwgeom_isfinite(lwblade_in))
+	{
+		lwpgerror("Blade Geometry contains invalid coordinates");
+		PG_RETURN_NULL();
+	}
+
+
 	lwgeom_out = lwgeom_split(lwgeom_in, lwblade_in);
 	lwgeom_free(lwgeom_in);
 	lwgeom_free(lwblade_in);
diff --git a/regress/core/split.sql b/regress/core/split.sql
index 2374026cc..a1087e171 100644
--- a/regress/core/split.sql
+++ b/regress/core/split.sql
@@ -107,4 +107,11 @@ select '86', ST_AsEWKT(ST_Split(
 select '87', ST_AsEWKT(ST_Split('SRID=4326;LINESTRING EMPTY', 'SRID=4326;POINT(0 1)'));
 
 
+-- https://trac.osgeo.org/postgis/ticket/5635 (split by nan input)
+SELECT '#5635a', ST_Split('LINESTRING Z (1 2 NaN,3 4 10,5 6 NaN)'::geometry
+					,'MULTIPOINT(EMPTY,2 1,2 4, 4 5)'::geometry);
+
+-- https://trac.osgeo.org/postgis/ticket/5635 (split by nan blade)
+SELECT '#5635b', ST_Split('LINESTRING Z (1 2 1,3 4 10,5 6 3)'::geometry
+					,'MULTIPOINT(1 NaN,2 1,2 4, 4 5)'::geometry);
 -- TODO: split line by collapsed line
diff --git a/regress/core/split_expected b/regress/core/split_expected
index b8a5287e9..62ec3cfeb 100644
--- a/regress/core/split_expected
+++ b/regress/core/split_expected
@@ -29,3 +29,5 @@ ERROR:  Splitter line has linear intersection with input
 85|SRID=3;GEOMETRYCOLLECTION(LINESTRING(1 -2,1 -1),LINESTRING(1 -1,1 1,3 1),LINESTRING(3 1,4 1))
 86|SRID=3;GEOMETRYCOLLECTION(LINESTRING(8 0,10 0),LINESTRING(0 0,5 0),LINESTRING(5 0,8 0),LINESTRING(5 0,5 5),LINESTRING(5 -2,5 0),LINESTRING(5 -5,5 -2),LINESTRING(8 20,10 20),LINESTRING(2 20,5 20),LINESTRING(0 20,2 20),LINESTRING(5 20,8 20))
 87|SRID=4326;GEOMETRYCOLLECTION(LINESTRING EMPTY)
+ERROR:  Input Geometry contains invalid coordinates
+ERROR:  Blade Geometry contains invalid coordinates

commit c1a0c55d70e26f19e534fd70b7cc1c8416b16abe
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Dec 1 15:43:18 2023 -0800

    News item for #5604

diff --git a/NEWS b/NEWS
index 857c5b274..638592a20 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
           in ST_SetPoint (Regina Obe)
  - #5627, Handling of EMPTY components in PiP check (Paul Ramsey)
  - #5629, Handling EMPTY components in repeated point removal (Paul Ramsey)
+ - #5604, Handle distance between collections with empty elements (Paul Ramsey)
 
 
 * Bug Fixes and Enhancments *

commit f45df01f77442e9e22c431b2d9a8deef7825d799
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Dec 1 15:32:28 2023 -0800

    Correctly handle distances between collections with empty elements, references #5604

diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c
index 3e255f9ec..b22b2cca1 100644
--- a/liblwgeom/measures.c
+++ b/liblwgeom/measures.c
@@ -299,7 +299,7 @@ lw_dist2d_recursive(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS *dl)
 			g1 = (LWGEOM *)lwg1;
 
 		if (lwgeom_is_empty(g1))
-			return LW_TRUE;
+			continue;
 
 		if (lw_dist2d_is_collection(g1))
 		{
@@ -329,10 +329,9 @@ lw_dist2d_recursive(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS *dl)
 			if (!g2->bbox)
 				lwgeom_add_bbox(g2);
 
-			/* If one of geometries is empty, return. True here only means continue searching. False would
-			 * have stopped the process*/
+			/* If one of geometries is empty, skip */
 			if (lwgeom_is_empty(g1) || lwgeom_is_empty(g2))
-				return LW_TRUE;
+				continue;
 
 			if ((dl->mode != DIST_MAX) && (!lw_dist2d_check_overlap(g1, g2)) &&
 			    (g1->type == LINETYPE || g1->type == POLYGONTYPE || g1->type == TRIANGLETYPE) &&
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index a1881fd6c..6623d3fca 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1517,3 +1517,12 @@ 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);
+
+SELECT '#5604',
+ ST_Distance(a2, a1),
+ ST_AsText(ST_ClosestPoint(a2, a1)),
+ ST_Distance(a1, a2),
+ ST_AsText(ST_ClosestPoint(a1, a2))
+FROM
+ST_GeomFromText('MULTIPOINT((-2 0), EMPTY)') AS a1,
+ST_GeomFromText('MULTIPOINT((1 0),(0 0))') AS a2;
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 8aa244cbd..f9ae3a346 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -469,3 +469,4 @@ ERROR:  Geometry contains invalid coordinates
 ERROR:  Geometry contains invalid coordinates
 #5378|4269
 #5627|t
+#5604|2|POINT(0 0)|2|POINT(-2 0)

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

Summary of changes:
 NEWS                          |  2 ++
 liblwgeom/measures.c          |  7 +++----
 postgis/lwgeom_geos.c         | 13 +++++++++++++
 regress/core/split.sql        |  7 +++++++
 regress/core/split_expected   |  2 ++
 regress/core/tickets.sql      |  9 +++++++++
 regress/core/tickets_expected |  1 +
 7 files changed, 37 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list