Skip to content

Commit

Permalink
Revert #5319
Browse files Browse the repository at this point in the history
no nonfinite reject needed for ST_SetPoint
References #5610 for PostGIS 3.2.7
  • Loading branch information
robe2 committed Nov 30, 2023
1 parent 7dfbcc0 commit b6702c5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -7,6 +7,8 @@ Additional features are enabled if you are running GEOS 3.9+
Proj 6.1+, and PostgreSQL 14+.

* Bug Fixes and Enhancements *
- #5610, Regression fix: Allow Nan and infinity again
in ST_SetPoint (Regina Obe)

PostGIS 3.2.6
2023/11/19
Expand Down
6 changes: 0 additions & 6 deletions postgis/lwgeom_functions_basic.c
Expand Up @@ -2456,12 +2456,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 */
Expand Down
5 changes: 5 additions & 0 deletions regress/core/setpoint.sql
Expand Up @@ -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;

3 changes: 2 additions & 1 deletion regress/core/setpoint_expected
Expand Up @@ -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)

0 comments on commit b6702c5

Please sign in to comment.