[SCM] PostGIS branch stable-3.1 updated. 3.1.10-4-g46ba92a17

git at osgeo.org git at osgeo.org
Wed Nov 29 19:47:45 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  46ba92a172eaa5b43955d70bf96dfd0d6fafc9a9 (commit)
      from  b8b0504491f23bf573b6c091adca10578496d453 (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 46ba92a172eaa5b43955d70bf96dfd0d6fafc9a9
Author: Regina Obe <lr at pcorp.us>
Date:   Wed Nov 29 21:06:22 2023 -0500

    Revert #5319
    no nonfinite reject needed for ST_SetPoint
    References #5610 for PostGIS 3.1.11

diff --git a/NEWS b/NEWS
index de2abcf1b..99ef26ccd 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PostGIS 3.1.11dev
 xxxx/xx/xx
 
 * Bug Fixes *
+ - #5610, Regression fix: Allow Nan and infinity again
+          in ST_SetPoint (Regina Obe)
 
 PostGIS 3.1.10
 2023/11/19
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index 1300f85fc..8d6e4decf 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2346,12 +2346,6 @@ Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS)
 		PG_RETURN_NULL();
 	}
 
-	if (!lwgeom_isfinite(lwg))
-	{
-		elog(ERROR, "Geometry contains invalid coordinate");
-		PG_RETURN_NULL();
-	}
-
 	if (which < 0)
 	{
 		/* Use backward indexing for negative values */
diff --git a/regress/core/setpoint.sql b/regress/core/setpoint.sql
index 553e50309..c6c7a0a50 100644
--- a/regress/core/setpoint.sql
+++ b/regress/core/setpoint.sql
@@ -29,3 +29,8 @@ SELECT ST_asewkt(ST_SetPoint('LINESTRING(0 0 0 0, 1 1 1 1, 2 2 2 2, 4 4 4 4)', 0
 -- https://trac.osgeo.org/postgis/ticket/5319
 SELECT '#5319', ST_SetPoint('0102000020E610000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry, 1,ST_GeomFromText('POINT(0 0)',4326)  )  As result;
 
+-- https://trac.osgeo.org/postgis/ticket/5610 (NaN check)
+SELECT '#5610', ST_AsText(ST_SetPoint(
+ST_Makeline(ARRAY[ST_MakePoint(1,2,'Nan'), ST_MakePoint(3,4,10), ST_MakePoint(5,6, 20)]),
+2, ST_MakePoint(5,6, 'Nan'))) AS result;
+
diff --git a/regress/core/setpoint_expected b/regress/core/setpoint_expected
index cbc622b07..c340c9886 100644
--- a/regress/core/setpoint_expected
+++ b/regress/core/setpoint_expected
@@ -11,4 +11,5 @@ LINESTRING(0 0 0 0,1 1 1 1,2 2 2 2,90 91 0 0)
 LINESTRING(0 0 0 0,1 1 1 1,90 91 92 0,4 4 4 4)
 LINESTRING(0 0 0 0,90 91 0 92,2 2 2 2,4 4 4 4)
 LINESTRING(90 91 92 93,1 1 1 1,2 2 2 2,4 4 4 4)
-ERROR:  Geometry contains invalid coordinate
+#5319|0102000020E610000005000000000000000000F07F000000000000F07F00000000000000000000000000000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F
+#5610|LINESTRING Z (1 2 NaN,3 4 10,5 6 NaN)

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

Summary of changes:
 NEWS                             | 2 ++
 postgis/lwgeom_functions_basic.c | 6 ------
 regress/core/setpoint.sql        | 5 +++++
 regress/core/setpoint_expected   | 3 ++-
 4 files changed, 9 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list