2959 extype = PG_GETARG_INT32(1);
2964 elog(ERROR,
"ST_CollectionExtract: only point, linestring and polygon may be extracted");
2968 gser_in = PG_GETARG_GSERIALIZED_P(0);
2975 if (lwg_in->
type == extype || !extype)
2978 PG_RETURN_POINTER(gser_in);
2984 PG_RETURN_POINTER(geometry_serialize(lwg_out));
2990 gser_out = geometry_serialize(lwg_out);
2993 PG_RETURN_POINTER(gser_out);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
LWCOLLECTION * lwcollection_extract(const LWCOLLECTION *col, uint32_t type)
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWGEOM * lwgeom_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)