GEOSGeometry* polygons;
const GEOSGeometry *vgeoms[1];
int i,n;
+ int hasZ = FLAGS_GET_Z(lwpoly_in->flags);
+
/* Possible outcomes:
*
/* debugging..
lwnotice("Bounds poly: %s",
- lwgeom_to_ewkt(GEOS2LWGEOM(g1_bounds, 0)));
+ lwgeom_to_ewkt(GEOS2LWGEOM(g1_bounds, hasZ)));
lwnotice("Line: %s",
- lwgeom_to_ewkt(GEOS2LWGEOM(g2, 0)));
+ lwgeom_to_ewkt(GEOS2LWGEOM(g2, hasZ)));
lwnotice("Noded bounds: %s",
- lwgeom_to_ewkt(GEOS2LWGEOM(vgeoms[0], 0)));
+ lwgeom_to_ewkt(GEOS2LWGEOM(vgeoms[0], hasZ)));
*/
polygons = GEOSPolygonize(vgeoms, 1);
* geometries and return the rest in a collection
*/
n = GEOSGetNumGeometries(polygons);
- out = lwcollection_construct(COLLECTIONTYPE, lwpoly_in->srid,
- NULL, 0, NULL);
+ out = lwcollection_construct_empty(COLLECTIONTYPE, lwpoly_in->srid,
+ hasZ, 0);
/* Allocate space for all polys */
out->geoms = lwalloc(sizeof(LWGEOM*)*n);
assert(0 == out->ngeoms);
continue;
}
- out->geoms[out->ngeoms++] = GEOS2LWGEOM(p, FLAGS_GET_Z(lwpoly_in->flags));
+ out->geoms[out->ngeoms++] = GEOS2LWGEOM(p, hasZ);
}
GEOSGeom_destroy(g1);
-- #1478
SELECT '#1478', 'SRID=1;POINT EMPTY'::geometry::text::geometry;
+-- #745
+SELECT '#745', ST_AsEWKT(ST_Split('POLYGON((-72 42 1,-70 43 1,-71 41 1,-72 42 1))',
+ 'LINESTRING(-10 40 1,-9 41 1)'));
+
-- Clean up
DELETE FROM spatial_ref_sys;