[SCM] PostGIS branch stable-3.1 updated. 3.1.10-12-gac11e3be8

git at osgeo.org git at osgeo.org
Mon Dec 4 11:06:28 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.1 has been updated
       via  ac11e3be8c373069113a647344484e745500d56a (commit)
       via  e3c87df458187b0d291d88d0b177aee586246dcc (commit)
       via  c41208a1a66492e0d8a9c39d436a6980c0e90d47 (commit)
      from  8b079c48fedd3021633903994d9d67c6fbc9b911 (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 ac11e3be8c373069113a647344484e745500d56a
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 4 10:58:34 2023 -0800

    Use WKB in NaN-based regression test, references #5635

diff --git a/regress/core/split.sql b/regress/core/split.sql
index a1087e171..1fd9edfc4 100644
--- a/regress/core/split.sql
+++ b/regress/core/split.sql
@@ -108,10 +108,12 @@ select '87', ST_AsEWKT(ST_Split('SRID=4326;LINESTRING EMPTY', 'SRID=4326;POINT(0
 
 
 -- 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);
+SELECT '#5635a', ST_Split(
+	'010200008003000000000000000000F03F0000000000000040000000000000F87F00000000000008400000000000001040000000000000244000000000000014400000000000001840000000000000F87F'::geometry
+	,'0104000000040000000101000000000000000000F87F000000000000F87F01010000000000000000000040000000000000F03F010100000000000000000000400000000000001040010100000000000000000010400000000000001440'::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);
+SELECT '#5635b', ST_Split(
+	'010200008003000000000000000000F03F0000000000000040000000000000F03F000000000000084000000000000010400000000000002440000000000000144000000000000018400000000000000840'::geometry
+	,'0104000000040000000101000000000000000000F03F000000000000F87F01010000000000000000000040000000000000F03F010100000000000000000000400000000000001040010100000000000000000010400000000000001440'::geometry);
 -- TODO: split line by collapsed line

commit e3c87df458187b0d291d88d0b177aee586246dcc
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 4 09:49:36 2023 -0800

    News item for #5635

diff --git a/NEWS b/NEWS
index 40cac7425..b4a02e4f2 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ xxxx/xx/xx
           in ST_SetPoint (Regina Obe)
  - #5627, Handling of EMPTY components in PiP check (Paul Ramsey)
  - #5604, Handle distance between collections with empty elements (Paul Ramsey)
+ - #5635, Handle NaN points in ST_Split (Regina Obe)
 
 
 PostGIS 3.1.10

commit c41208a1a66492e0d8a9c39d436a6980c0e90d47
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 932732528..a6fbcd899 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -3344,6 +3344,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      |  9 +++++++++
 regress/core/split_expected |  2 ++
 4 files changed, 25 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list