793 bytea *bytea_wkb = PG_GETARG_BYTEA_P(0);
797 uint8_t *wkb = (uint8_t*)VARDATA(bytea_wkb);
801 lwpgerror(
"Unable to parse WKB");
803 geom = geometry_serialize(lwgeom);
805 PG_FREE_IF_COPY(bytea_wkb, 0);
809 elog(WARNING,
"OGC WKB expected, EWKB provided - use GeometryFromEWKB() for this");
812 if ( PG_NARGS() > 1 )
814 srid = PG_GETARG_INT32(1);
819 PG_RETURN_POINTER(geom);
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
void gserialized_set_srid(GSERIALIZED *g, int32_t srid)
Write the SRID into the serialized form (it is packed into three bytes so this is a handy function).
#define LW_PARSER_CHECK_ALL
void lwgeom_free(LWGEOM *geom)
#define SRID_UNKNOWN
Unknown SRID value.
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...