]> granicus.if.org Git - postgis/commitdiff
Fix ST_Polygonize aggregate to retain Z (#1602)
authorSandro Santilli <strk@keybit.net>
Wed, 22 Feb 2012 17:19:42 +0000 (17:19 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 22 Feb 2012 17:19:42 +0000 (17:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9258 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_geos.c
regress/polygonize.sql
regress/polygonize_expected

index 1ffde5befcf99090d9db38f0527763a5eacdc254..ec15ff6990915eb979fa8fad3ede358e3babae80 100644 (file)
@@ -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 */
index 1687dc4da2d1c9dfc1379e6d7dc5da09da558ec8..489c7088cbccd2f193bc3630573913e5517a9d3d 100644 (file)
@@ -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));
index 259697b32b21b9edef8f09395e832deb46465131..0555ee5c52992b0d138c65476899be861854bab6 100644 (file)
@@ -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)))