[SCM] PostGIS branch stable-3.3 updated. 3.3.5-13-gc87887fb6

git at osgeo.org git at osgeo.org
Mon Dec 4 11:06:43 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.3 has been updated
       via  c87887fb6a941c5b802b97bd4e59772d1f8f90ac (commit)
       via  41b7674876c588aaa24375225ab815ef520b2c5c (commit)
      from  5b5040219a9801c7022f19666b09c5a7a467c568 (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 c87887fb6a941c5b802b97bd4e59772d1f8f90ac
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 4 09:48:29 2023 -0800

    News item for #5635

diff --git a/NEWS b/NEWS
index cfb6df37f..f64c3cff6 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Proj 6.1+, and PostgreSQL 15+.
  - #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)
 
 
 PostGIS 3.3.5

commit 41b7674876c588aaa24375225ab815ef520b2c5c
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 e1de4baad..5dd5dd96c 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -3279,6 +3279,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

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

Summary of changes:
 NEWS                        |  1 +
 postgis/lwgeom_geos.c       | 13 +++++++++++++
 regress/core/split.sql      |  7 +++++++
 regress/core/split_expected |  2 ++
 4 files changed, 23 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list