641{
644 size_t size_result;
645 uint8_t *wkb;
646 bytea *result;
647
648 g = PG_GETARG_GSERIALIZED_P(0);
652
653 result = palloc(size_result + VARHDRSZ);
654 SET_VARSIZE(result, size_result + VARHDRSZ);
655 memcpy(VARDATA(result), wkb, size_result);
657
658 PG_RETURN_POINTER(result);
659}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
uint8_t * lwgeom_to_wkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)
Convert LWGEOM to a char* in WKB format.