PostGIS  2.2.8dev-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 209 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().

210 {
211  int i;
212  char *ptr=output;
213 
214  for (i=0; i<poly->nrings; i++)
215  {
216  if (i) ptr += sprintf(ptr, " "); /* Space beetween each ring */
217  ptr += sprintf(ptr, "M "); /* Start path with SVG MoveTo */
218 
219  if (relative)
220  {
221  ptr += pointArray_svg_rel(poly->rings[i], ptr, 0, precision);
222  ptr += sprintf(ptr, " z"); /* SVG closepath */
223  }
224  else
225  {
226  ptr += pointArray_svg_abs(poly->rings[i], ptr, 0, precision);
227  ptr += sprintf(ptr, " Z"); /* SVG closepath */
228  }
229  }
230 
231  return (ptr-output);
232 }
static size_t pointArray_svg_rel(POINTARRAY *pa, char *output, int close_ring, int precision)
Definition: lwout_svg.c:546
POINTARRAY ** rings
Definition: liblwgeom.h:441
uint8_t precision
Definition: cu_in_twkb.c:25
int nrings
Definition: liblwgeom.h:439
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:632
Here is the call graph for this function:
Here is the caller graph for this function: