351 bytea *bytea_wkb = PG_GETARG_BYTEA_P(0);
354 uint8_t *wkb = (uint8_t*)VARDATA(bytea_wkb);
358 lwpgerror(
"Unable to parse WKB");
360 if ((PG_NARGS() > 1) && (!PG_ARGISNULL(1)))
362 int32 srid = PG_GETARG_INT32(1);
369 geom = geometry_serialize(lwgeom);
371 PG_FREE_IF_COPY(bytea_wkb, 0);
372 PG_RETURN_POINTER(geom);
#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.