PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t assvg_polygon_buf ( const LWPOLY poly,
char *  output,
int  relative,
int  precision 
)
static

Definition at line 210 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().

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

Here is the call graph for this function:

Here is the caller graph for this function: