PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ assvg_polygon_buf()

static size_t assvg_polygon_buf ( const LWPOLY poly,
char *  output,
int  relative,
int  precision 
)
static

Definition at line 223 of file lwout_svg.c.

References LWPOLY::nrings, pointArray_svg_abs(), pointArray_svg_rel(), and LWPOLY::rings.

Referenced by assvg_geom_buf(), assvg_multipolygon_buf(), and assvg_polygon().

224 {
225  int i;
226  char *ptr=output;
227 
228  for (i=0; i<poly->nrings; i++)
229  {
230  if (i) ptr += sprintf(ptr, " "); /* Space beetween each ring */
231  ptr += sprintf(ptr, "M "); /* Start path with SVG MoveTo */
232 
233  if (relative)
234  {
235  ptr += pointArray_svg_rel(poly->rings[i], ptr, 0, precision);
236  ptr += sprintf(ptr, " z"); /* SVG closepath */
237  }
238  else
239  {
240  ptr += pointArray_svg_abs(poly->rings[i], ptr, 0, precision);
241  ptr += sprintf(ptr, " Z"); /* SVG closepath */
242  }
243  }
244 
245  return (ptr-output);
246 }
static size_t pointArray_svg_rel(POINTARRAY *pa, char *output, int close_ring, int precision)
Definition: lwout_svg.c:560
POINTARRAY ** rings
Definition: liblwgeom.h:457
uint8_t precision
Definition: cu_in_twkb.c:25
int nrings
Definition: liblwgeom.h:455
static size_t pointArray_svg_abs(POINTARRAY *pa, char *output, int close_ring, int precision)
Returns maximum size of rendered pointarray in bytes.
Definition: lwout_svg.c:646
Here is the call graph for this function:
Here is the caller graph for this function: