[SCM] PostGIS branch stable-3.0 updated. 3.0.10-11-g190d92ad5

git at osgeo.org git at osgeo.org
Mon Dec 4 11:06:21 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.0 has been updated
       via  190d92ad5acf13644a7c781623b6534a3f9a7e14 (commit)
       via  b4e27c1a6bf50cec169f6e2e5b0607bbedc010a9 (commit)
       via  c5d91e6b90a542b60184904458967a57f6b9971d (commit)
      from  0437cc0f206c76b2ac428656fa98729468c451f1 (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 190d92ad5acf13644a7c781623b6534a3f9a7e14
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 4 10:58:24 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 b4e27c1a6bf50cec169f6e2e5b0607bbedc010a9
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Dec 4 09:50:44 2023 -0800

    News item for #5635

diff --git a/NEWS b/NEWS
index 47256754b..3ee229606 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,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.0.10

commit c5d91e6b90a542b60184904458967a57f6b9971d
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 f06826189..21cbdbd84 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -3192,6 +3192,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 e03adcd1f..4bf7bdac2 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