PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ LWGEOM_asSVG()

Datum LWGEOM_asSVG ( PG_FUNCTION_ARGS  )

Definition at line 305 of file lwgeom_export.c.

306 {
307  GSERIALIZED *geom;
308  LWGEOM *lwgeom;
309  int relative = 0;
311 
312  if ( PG_ARGISNULL(0) ) PG_RETURN_NULL();
313 
314  geom = PG_GETARG_GSERIALIZED_P(0);
315 
316  /* check for relative path notation */
317  if ( PG_NARGS() > 1 && ! PG_ARGISNULL(1) )
318  relative = PG_GETARG_INT32(1) ? 1:0;
319 
320  if ( PG_NARGS() > 2 && ! PG_ARGISNULL(2) )
321  {
322  precision = PG_GETARG_INT32(2);
323  }
324 
325  lwgeom = lwgeom_from_gserialized(geom);
326  PG_RETURN_TEXT_P(lwgeom_to_svg(lwgeom, precision, relative));
327 }
static uint8_t precision
Definition: cu_in_twkb.c:25
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
lwvarlena_t * lwgeom_to_svg(const LWGEOM *geom, int precision, int relative)
Takes a GEOMETRY and returns a SVG representation.
Definition: lwout_svg.c:559
#define OUT_DEFAULT_DECIMAL_DIGITS

References lwgeom_from_gserialized(), lwgeom_to_svg(), OUT_DEFAULT_DECIMAL_DIGITS, and precision.

Here is the call graph for this function: