From: Sandro Santilli Date: Wed, 22 Feb 2012 17:19:42 +0000 (+0000) Subject: Fix ST_Polygonize aggregate to retain Z (#1602) X-Git-Tag: 2.0.0alpha6~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b37b7ccd99f2dafbd918491fff32e716e3fad24b;p=postgis Fix ST_Polygonize aggregate to retain Z (#1602) git-svn-id: http://svn.osgeo.org/postgis/trunk@9258 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 1ffde5bef..ec15ff699 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -3288,6 +3288,7 @@ Datum polygonize_garray(PG_FUNCTION_ARGS) GEOSGeometry* g; GSERIALIZED *geom = (GSERIALIZED *)(ARR_DATA_PTR(array)+offset); offset += INTALIGN(VARSIZE(geom)); + if ( ! is3d ) is3d = gserialized_has_z(geom); g = (GEOSGeometry *)POSTGIS2GEOS(geom); if ( 0 == g ) /* exception thrown at construction */ diff --git a/regress/polygonize.sql b/regress/polygonize.sql index 1687dc4da..489c7088c 100644 --- a/regress/polygonize.sql +++ b/regress/polygonize.sql @@ -6,3 +6,8 @@ SELECT 1, ST_AsText(ST_Polygonize( ), LINESTRING(1656309.68 4833337.07,1656318.45 4833344.45) )'::geometry)); + +-- See ticket #1602 +SELECT 2, ST_AsEWKT(ST_Polygonize( +'MULTILINESTRING((0 0 0, 0 10 0, 10 10 0),(10 10 0, 10 0 5, 0 0 0))' +::geometry)); diff --git a/regress/polygonize_expected b/regress/polygonize_expected index 259697b32..0555ee5c5 100644 --- a/regress/polygonize_expected +++ b/regress/polygonize_expected @@ -1 +1,2 @@ 1|GEOMETRYCOLLECTION(POLYGON((1656318.45 4833344.45,1656321.79 4833339.62,1656312.54 4833333.49,1656309.68 4833337.07,1656318.45 4833344.45))) +2|GEOMETRYCOLLECTION(POLYGON((0 0 0,0 10 0,10 10 0,10 0 5,0 0 0)))