[SCM] PostGIS branch master updated. 3.4.0rc1-900-g2962a3650

git at osgeo.org git at osgeo.org
Thu Jan 25 11:45:13 PST 2024


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  2962a3650d2a268fbfc7645d615be64804a9a127 (commit)
      from  f5d6c10b7de4cc6cac4e809d495aa4ad25ca4743 (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 2962a3650d2a268fbfc7645d615be64804a9a127
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Jan 25 11:45:06 2024 -0800

    ST_AsGeoJSON, produce correct output in null geometry case, closes #5597

diff --git a/postgis/lwgeom_out_geojson.c b/postgis/lwgeom_out_geojson.c
index 3d6beaf3f..530ca6559 100644
--- a/postgis/lwgeom_out_geojson.c
+++ b/postgis/lwgeom_out_geojson.c
@@ -203,7 +203,7 @@ composite_to_geojson(FunctionCallInfo fcinfo,
 			}
 			else
 			{
-				appendStringInfoString(result, "{\"type\": null}");
+				appendStringInfoString(result, "null");
 			}
 		}
 		else if (is_id_column)
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index dd94af1b5..4b69ec20c 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1537,3 +1537,5 @@ FROM (VALUES
 ,(6, 'LINESTRING(0 0, 10 0)', 'LINESTRING(0 2, 10 4)', 3)
 ,(7, 'LINESTRING(0 0, 10 0)', 'LINESTRING(0 2, 10 4)', 4)
 ) AS t(id, a, b, r);
+
+SELECT '#5597', ST_AsGeoJSON(r.*) from (values (null::geometry)) as r(geom);
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 41d2f1e91..234d147ef 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -477,3 +477,4 @@ ERROR:  Geometry contains invalid coordinates
 #5639|fullywithin5|f
 #5639|fullywithin6|f
 #5639|fullywithin7|t
+#5597|{"type": "Feature", "geometry": null, "properties": {}}

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

Summary of changes:
 postgis/lwgeom_out_geojson.c  | 2 +-
 regress/core/tickets.sql      | 2 ++
 regress/core/tickets_expected | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list