PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ LWGEOM_asSVG()

Datum LWGEOM_asSVG ( PG_FUNCTION_ARGS  )

Definition at line 294 of file lwgeom_export.c.

295 {
296  GSERIALIZED *geom;
297  LWGEOM *lwgeom;
298  int relative = 0;
300 
301  if ( PG_ARGISNULL(0) ) PG_RETURN_NULL();
302 
303  geom = PG_GETARG_GSERIALIZED_P(0);
304 
305  /* check for relative path notation */
306  if ( PG_NARGS() > 1 && ! PG_ARGISNULL(1) )
307  relative = PG_GETARG_INT32(1) ? 1:0;
308 
309  if ( PG_NARGS() > 2 && ! PG_ARGISNULL(2) )
310  {
311  precision = PG_GETARG_INT32(2);
312  }
313 
314  lwgeom = lwgeom_from_gserialized(geom);
315  PG_RETURN_TEXT_P(lwgeom_to_svg(lwgeom, precision, relative));
316 }
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:56
#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: