303 if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) )
305 type = PG_GETARG_TEXT_P(1);
307 if ( ! strncmp(VARDATA(
type),
"xdr", 3) ||
308 ! strncmp(VARDATA(
type),
"XDR", 3) )
324 text_size = hexwkb_size - 1 + VARHDRSZ;
325 result = palloc(text_size);
326 memcpy(VARDATA(result), hexwkb, hexwkb_size - 1);
327 SET_VARSIZE(result, text_size);
331 PG_FREE_IF_COPY(geom, 0);
332 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)