[SCM] PostGIS branch stable-3.4 updated. 3.4.2-4-gf37390b9c
git at osgeo.org
git at osgeo.org
Mon Feb 26 11:31:58 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, stable-3.4 has been updated
via f37390b9cc4b33e8a7ec15e0396112fca19391c9 (commit)
from c19da1107e59706741234b0fa2e49823dd0a0080 (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 f37390b9cc4b33e8a7ec15e0396112fca19391c9
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon Feb 26 11:31:31 2024 -0800
ST_Union(geom[]) should unary union single entry arrays
References #5677
diff --git a/NEWS b/NEWS
index 4a548af07..adc9d238a 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
* Bug Fixes *
- #5649, ST_Value should return NULL on missing band (Paul Ramsey)
+ - #5677, ST_Union(geom[]) should unary union single entry arrays (Paul Ramsey)
PostGIS 3.4.2
diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c
index 28b5c3e68..38b4f8c64 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -639,6 +639,9 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
if ( count == 0 )
PG_RETURN_NULL();
+ /* Ok, we really need GEOS now ;) */
+ initGEOS(lwpgnotice, lwgeom_geos_error);
+
/* One geom, good geom? Return it */
if ( count == 1 && nelems == 1 )
{
@@ -646,15 +649,19 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
#endif
- PG_RETURN_POINTER((GSERIALIZED *)(ARR_DATA_PTR(array)));
+ g = POSTGIS2GEOS((GSERIALIZED *)(ARR_DATA_PTR(array)));
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif
+ g_union = GEOSUnaryUnion(g);
+ GEOSGeom_destroy(g);
+ if (!g_union) HANDLE_GEOS_ERROR("GEOSUnaryUnion");
+ GEOSSetSRID(g_union, srid);
+ gser_out = GEOS2POSTGIS(g_union, is3d);
+ GEOSGeom_destroy(g_union);
+ PG_RETURN_POINTER(gser_out);
}
- /* Ok, we really need GEOS now ;) */
- initGEOS(lwpgnotice, lwgeom_geos_error);
-
/*
** Collect the non-empty inputs and stuff them into a GEOS collection
*/
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
postgis/lwgeom_geos.c | 15 +++++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list