374{
378 int32 idx = PG_GETARG_INT32(1);
380
381
383
384 if (!subgeom)
385 PG_RETURN_NULL();
386
387
388 if (subgeom != lwgeom)
389 {
391
393 }
394 result = geometry_serialize(subgeom);
395 PG_FREE_IF_COPY(geom, 0);
396 PG_RETURN_POINTER(
result);
397}
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
static LWGEOM * lwgeom_extract_geometry_n(LWGEOM *lwgeom, int32 idx, bool patches_as_geometries)