299 if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) )
301 type = PG_GETARG_TEXT_P(1);
303 if ( ! strncmp(VARDATA(
type),
"xdr", 3) ||
304 ! strncmp(VARDATA(
type),
"XDR", 3) )
320 text_size = hexwkb_size - 1 + VARHDRSZ;
321 result = palloc(text_size);
322 memcpy(VARDATA(result), hexwkb, hexwkb_size - 1);
323 SET_VARSIZE(result, text_size);
327 PG_FREE_IF_COPY(geom, 0);
328 PG_RETURN_TEXT_P(result);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
char * lwgeom_to_hexwkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)