352{
353 bytea *bytea_wkb = PG_GETARG_BYTEA_P(0);
356 uint8_t *wkb = (uint8_t*)VARDATA(bytea_wkb);
357
359 if (!lwgeom)
360 lwpgerror("Unable to parse WKB");
361
362 if ((PG_NARGS() > 1) && (!PG_ARGISNULL(1)))
363 {
364 int32 srid = PG_GETARG_INT32(1);
366 }
367
370
371 geom = geometry_serialize(lwgeom);
373 PG_FREE_IF_COPY(bytea_wkb, 0);
374 PG_RETURN_POINTER(geom);
375}
#define LW_PARSER_CHECK_ALL
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UN...
void lwgeom_free(LWGEOM *geom)
int lwgeom_needs_bbox(const LWGEOM *geom)
Check whether or not a lwgeom is big enough to warrant a bounding box.
LWGEOM * lwgeom_from_wkb(const uint8_t *wkb, const size_t wkb_size, const char check)
WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory...
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.