[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-637-gc2dbb220d

git at osgeo.org git at osgeo.org
Sat Feb 18 00:23:08 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, master has been updated
       via  c2dbb220d05789dd4f4ae76b19071c2c742444ea (commit)
      from  f93359b21380998e86a38805f069bd22383ccf6e (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 c2dbb220d05789dd4f4ae76b19071c2c742444ea
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Feb 18 03:18:24 2023 -0500

    ST_AsLatLon infinite coordinate. References #5342 for PostGIS 3.4

diff --git a/postgis/lwgeom_inout.c b/postgis/lwgeom_inout.c
index d5b076846..55f335893 100644
--- a/postgis/lwgeom_inout.c
+++ b/postgis/lwgeom_inout.c
@@ -236,6 +236,11 @@ Datum LWGEOM_to_latlon(PG_FUNCTION_ARGS)
     PG_RETURN_NULL();
   }
 
+	if (!lwgeom_isfinite(lwgeom)) {
+    lwpgerror("ST_AsLatLonText: invalid coordinate");
+    PG_RETURN_NULL();
+  }
+
 	format_str = text_to_cstring(format_text);
   assert(format_str != NULL);
 
diff --git a/regress/core/out_geometry.sql b/regress/core/out_geometry.sql
index b8f41b913..e3c6ecc01 100644
--- a/regress/core/out_geometry.sql
+++ b/regress/core/out_geometry.sql
@@ -172,4 +172,7 @@ SELECT 'text_precision_02', ST_AsText(GeomFromEWKT('SRID=4326;POINT(111.1111111
 --
 SELECT 'EWKT_' || i, ST_AsEWKT('SRID=4326;POINT(12345678.123456789 1)'::geometry, i)
 FROM generate_series(0, 20) AS t(i)
-ORDER BY i;
\ No newline at end of file
+ORDER BY i;
+
+-- infinite latlon https://trac.osgeo.org/postgis/ticket/5342
+SELECT '#5342' As ticket, ST_AsLatLonText('0101000020E6100000000000000000F07F000000000000F07F'::geometry);
diff --git a/regress/core/out_geometry_expected b/regress/core/out_geometry_expected
index 13f0c88bd..029439849 100644
--- a/regress/core/out_geometry_expected
+++ b/regress/core/out_geometry_expected
@@ -111,3 +111,4 @@ EWKT_17|SRID=4326;POINT(12345678.12345679 1)
 EWKT_18|SRID=4326;POINT(12345678.12345679 1)
 EWKT_19|SRID=4326;POINT(12345678.12345679 1)
 EWKT_20|SRID=4326;POINT(12345678.12345679 1)
+ERROR:  ST_AsLatLonText: invalid coordinate

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

Summary of changes:
 postgis/lwgeom_inout.c             | 5 +++++
 regress/core/out_geometry.sql      | 5 ++++-
 regress/core/out_geometry_expected | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list