for (i=0; i<col->ngeoms; i++)
newgeoms[i] = lwgeom_segmentize2d(col->geoms[i], dist);
- return lwcollection_construct(col->type, col->SRID, col->bbox,
+ return lwcollection_construct(col->type, col->SRID, NULL,
col->ngeoms, newgeoms);
}
inlwgeom = lwgeom_deserialize(SERIALIZED_FORM(ingeom));
outlwgeom = lwgeom_segmentize2d(inlwgeom, dist);
+
+ // Copy input bounding box if any
+ if ( inlwgeom->bbox )
+ outlwgeom->bbox = box2d_clone(inlwgeom->bbox);
+
outgeom = pglwgeom_serialize(outlwgeom);
PG_FREE_IF_COPY(ingeom, 0);
POINTARRAY *extring;
LWLINE *line;
PG_LWGEOM *result;
+ BOX2DFLOAT4 *bbox=NULL;
if ( TYPE_GETTYPE(geom->type) != POLYGONTYPE )
{
// This is a LWLINE constructed by exterior ring POINTARRAY
// If the input geom has a bbox, use it for
// the output geom, as exterior ring makes it up !
- line = lwline_construct(poly->SRID, poly->bbox, extring);
+ if ( poly->bbox ) bbox=box2d_clone(poly->bbox);
+ line = lwline_construct(poly->SRID, bbox, extring);
result = pglwgeom_serialize((LWGEOM *)line);
LWLINE *
lwline_segmentize2d(LWLINE *line, double dist)
{
- return lwline_construct(line->SRID, line->bbox,
+ return lwline_construct(line->SRID, NULL,
ptarray_segmentize2d(line->points, dist));
}
{
newrings[i] = ptarray_segmentize2d(poly->rings[i], dist);
}
- return lwpoly_construct(poly->SRID, poly->bbox,
+ return lwpoly_construct(poly->SRID, NULL,
poly->nrings, newrings);
}