483{
486 char *svg;
487 text *result;
488 int relative = 0;
490
491 if ( PG_ARGISNULL(0) ) PG_RETURN_NULL();
492
493 geom = PG_GETARG_GSERIALIZED_P(0);
494
495
496 if ( PG_NARGS() > 1 && ! PG_ARGISNULL(1) )
497 relative = PG_GETARG_INT32(1) ? 1:0;
498
499 if ( PG_NARGS() > 2 && ! PG_ARGISNULL(2) )
500 {
502
506 }
507
510 result = cstring_to_text(svg);
512 pfree(svg);
513 PG_FREE_IF_COPY(geom, 0);
514
515 PG_RETURN_TEXT_P(result);
516}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
char * lwgeom_to_svg(const LWGEOM *geom, int precision, int relative)
Takes a GEOMETRY and returns a SVG representation.