PostGIS  3.1.6dev-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 207 of file lwout_svg.c.

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

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

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

Here is the call graph for this function:
Here is the caller graph for this function: