PostGIS  2.1.10dev-r@@SVN_REVISION@@
lwout_svg.c
Go to the documentation of this file.
1 /**********************************************************************
2  * $Id: lwout_svg.c 14455 2015-11-30 16:30:57Z pramsey $
3  *
4  * PostGIS - Spatial Types for PostgreSQL
5  * http://postgis.net
6  * Copyright 2001-2003 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of hte GNU General Public Licence. See the COPYING file.
10  *
11  **********************************************************************/
12 
22 #include "liblwgeom_internal.h"
23 
24 static char * assvg_point(const LWPOINT *point, int relative, int precision);
25 static char * assvg_line(const LWLINE *line, int relative, int precision);
26 static char * assvg_polygon(const LWPOLY *poly, int relative, int precision);
27 static char * assvg_multipoint(const LWMPOINT *mpoint, int relative, int precision);
28 static char * assvg_multiline(const LWMLINE *mline, int relative, int precision);
29 static char * assvg_multipolygon(const LWMPOLY *mpoly, int relative, int precision);
30 static char * assvg_collection(const LWCOLLECTION *col, int relative, int precision);
31 
32 static size_t assvg_geom_size(const LWGEOM *geom, int relative, int precision);
33 static size_t assvg_geom_buf(const LWGEOM *geom, char *output, int relative, int precision);
34 static size_t pointArray_svg_size(POINTARRAY *pa, int precision);
35 static size_t pointArray_svg_rel(POINTARRAY *pa, char * output, int close_ring, int precision);
36 static size_t pointArray_svg_abs(POINTARRAY *pa, char * output, int close_ring, int precision);
37 
38 
42 char *
43 lwgeom_to_svg(const LWGEOM *geom, int precision, int relative)
44 {
45  char *ret = NULL;
46  int type = geom->type;
47 
48  /* Empty string for empties */
49  if( lwgeom_is_empty(geom) )
50  {
51  ret = lwalloc(1);
52  ret[0] = '\0';
53  return ret;
54  }
55 
56  switch (type)
57  {
58  case POINTTYPE:
59  ret = assvg_point((LWPOINT*)geom, relative, precision);
60  break;
61  case LINETYPE:
62  ret = assvg_line((LWLINE*)geom, relative, precision);
63  break;
64  case POLYGONTYPE:
65  ret = assvg_polygon((LWPOLY*)geom, relative, precision);
66  break;
67  case MULTIPOINTTYPE:
68  ret = assvg_multipoint((LWMPOINT*)geom, relative, precision);
69  break;
70  case MULTILINETYPE:
71  ret = assvg_multiline((LWMLINE*)geom, relative, precision);
72  break;
73  case MULTIPOLYGONTYPE:
74  ret = assvg_multipolygon((LWMPOLY*)geom, relative, precision);
75  break;
76  case COLLECTIONTYPE:
77  ret = assvg_collection((LWCOLLECTION*)geom, relative, precision);
78  break;
79 
80  default:
81  lwerror("lwgeom_to_svg: '%s' geometry type not supported",
82  lwtype_name(type));
83  }
84 
85  return ret;
86 }
87 
88 
93 static size_t
94 assvg_point_size(const LWPOINT *point, int circle, int precision)
95 {
96  size_t size;
97 
98  size = (OUT_MAX_DIGS_DOUBLE + precision) * 2;
99  if (circle) size += sizeof("cx='' cy=''");
100  else size += sizeof("x='' y=''");
101 
102  return size;
103 }
104 
105 static size_t
106 assvg_point_buf(const LWPOINT *point, char * output, int circle, int precision)
107 {
108  char *ptr=output;
111  POINT2D pt;
112 
113  getPoint2d_p(point->point, 0, &pt);
114 
115  if (fabs(pt.x) < OUT_MAX_DOUBLE)
116  sprintf(x, "%.*f", precision, pt.x);
117  else
118  sprintf(x, "%g", pt.x);
120 
121  /* SVG Y axis is reversed, an no need to transform 0 into -0 */
122  if (fabs(pt.y) < OUT_MAX_DOUBLE)
123  sprintf(y, "%.*f", precision, fabs(pt.y) ? pt.y * -1 : pt.y);
124  else
125  sprintf(y, "%g", fabs(pt.y) ? pt.y * -1 : pt.y);
127 
128  if (circle) ptr += sprintf(ptr, "x=\"%s\" y=\"%s\"", x, y);
129  else ptr += sprintf(ptr, "cx=\"%s\" cy=\"%s\"", x, y);
130 
131  return (ptr-output);
132 }
133 
134 static char *
135 assvg_point(const LWPOINT *point, int circle, int precision)
136 {
137  char *output;
138  int size;
139 
140  size = assvg_point_size(point, circle, precision);
141  output = lwalloc(size);
142  assvg_point_buf(point, output, circle, precision);
143 
144  return output;
145 }
146 
147 
152 static size_t
153 assvg_line_size(const LWLINE *line, int relative, int precision)
154 {
155  size_t size;
156 
157  size = sizeof("M ");
158  size += pointArray_svg_size(line->points, precision);
159 
160  return size;
161 }
162 
163 static size_t
164 assvg_line_buf(const LWLINE *line, char * output, int relative, int precision)
165 {
166  char *ptr=output;
167 
168  /* Start path with SVG MoveTo */
169  ptr += sprintf(ptr, "M ");
170  if (relative)
171  ptr += pointArray_svg_rel(line->points, ptr, 1, precision);
172  else
173  ptr += pointArray_svg_abs(line->points, ptr, 1, precision);
174 
175  return (ptr-output);
176 }
177 
178 static char *
179 assvg_line(const LWLINE *line, int relative, int precision)
180 {
181  char *output;
182  int size;
183 
184  size = assvg_line_size(line, relative, precision);
185  output = lwalloc(size);
186  assvg_line_buf(line, output, relative, precision);
187 
188  return output;
189 }
190 
191 
196 static size_t
197 assvg_polygon_size(const LWPOLY *poly, int relative, int precision)
198 {
199  int i;
200  size_t size=0;
201 
202  for (i=0; i<poly->nrings; i++)
203  size += pointArray_svg_size(poly->rings[i], precision) + sizeof(" ");
204  size += sizeof("M Z") * poly->nrings;
205 
206  return size;
207 }
208 
209 static size_t
210 assvg_polygon_buf(const LWPOLY *poly, char * output, int relative, int precision)
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 }
234 
235 static char *
236 assvg_polygon(const LWPOLY *poly, int relative, int precision)
237 {
238  char *output;
239  int size;
240 
241  size = assvg_polygon_size(poly, relative, precision);
242  output = lwalloc(size);
243  assvg_polygon_buf(poly, output, relative, precision);
244 
245  return output;
246 }
247 
248 
253 static size_t
254 assvg_multipoint_size(const LWMPOINT *mpoint, int relative, int precision)
255 {
256  const LWPOINT *point;
257  size_t size=0;
258  int i;
259 
260  for (i=0 ; i<mpoint->ngeoms ; i++)
261  {
262  point = mpoint->geoms[i];
263  size += assvg_point_size(point, relative, precision);
264  }
265  size += sizeof(",") * --i; /* Arbitrary comma separator */
266 
267  return size;
268 }
269 
270 static size_t
271 assvg_multipoint_buf(const LWMPOINT *mpoint, char *output, int relative, int precision)
272 {
273  const LWPOINT *point;
274  int i;
275  char *ptr=output;
276 
277  for (i=0 ; i<mpoint->ngeoms ; i++)
278  {
279  if (i) ptr += sprintf(ptr, ","); /* Arbitrary comma separator */
280  point = mpoint->geoms[i];
281  ptr += assvg_point_buf(point, ptr, relative, precision);
282  }
283 
284  return (ptr-output);
285 }
286 
287 static char *
288 assvg_multipoint(const LWMPOINT *mpoint, int relative, int precision)
289 {
290  char *output;
291  int size;
292 
293  size = assvg_multipoint_size(mpoint, relative, precision);
294  output = lwalloc(size);
295  assvg_multipoint_buf(mpoint, output, relative, precision);
296 
297  return output;
298 }
299 
300 
305 static size_t
306 assvg_multiline_size(const LWMLINE *mline, int relative, int precision)
307 {
308  const LWLINE *line;
309  size_t size=0;
310  int i;
311 
312  for (i=0 ; i<mline->ngeoms ; i++)
313  {
314  line = mline->geoms[i];
315  size += assvg_line_size(line, relative, precision);
316  }
317  size += sizeof(" ") * --i; /* SVG whitespace Separator */
318 
319  return size;
320 }
321 
322 static size_t
323 assvg_multiline_buf(const LWMLINE *mline, char *output, int relative, int precision)
324 {
325  const LWLINE *line;
326  int i;
327  char *ptr=output;
328 
329  for (i=0 ; i<mline->ngeoms ; i++)
330  {
331  if (i) ptr += sprintf(ptr, " "); /* SVG whitespace Separator */
332  line = mline->geoms[i];
333  ptr += assvg_line_buf(line, ptr, relative, precision);
334  }
335 
336  return (ptr-output);
337 }
338 
339 static char *
340 assvg_multiline(const LWMLINE *mline, int relative, int precision)
341 {
342  char *output;
343  int size;
344 
345  size = assvg_multiline_size(mline, relative, precision);
346  output = lwalloc(size);
347  assvg_multiline_buf(mline, output, relative, precision);
348 
349  return output;
350 }
351 
352 
353 /*
354  * Multipolygon Geometry
355  */
356 
357 static size_t
358 assvg_multipolygon_size(const LWMPOLY *mpoly, int relative, int precision)
359 {
360  const LWPOLY *poly;
361  size_t size=0;
362  int i;
363 
364  for (i=0 ; i<mpoly->ngeoms ; i++)
365  {
366  poly = mpoly->geoms[i];
367  size += assvg_polygon_size(poly, relative, precision);
368  }
369  size += sizeof(" ") * --i; /* SVG whitespace Separator */
370 
371  return size;
372 }
373 
374 static size_t
375 assvg_multipolygon_buf(const LWMPOLY *mpoly, char *output, int relative, int precision)
376 {
377  const LWPOLY *poly;
378  int i;
379  char *ptr=output;
380 
381  for (i=0 ; i<mpoly->ngeoms ; i++)
382  {
383  if (i) ptr += sprintf(ptr, " "); /* SVG whitespace Separator */
384  poly = mpoly->geoms[i];
385  ptr += assvg_polygon_buf(poly, ptr, relative, precision);
386  }
387 
388  return (ptr-output);
389 }
390 
391 static char *
392 assvg_multipolygon(const LWMPOLY *mpoly, int relative, int precision)
393 {
394  char *output;
395  int size;
396 
397  size = assvg_multipolygon_size(mpoly, relative, precision);
398  output = lwalloc(size);
399  assvg_multipolygon_buf(mpoly, output, relative, precision);
400 
401  return output;
402 }
403 
404 
409 static size_t
410 assvg_collection_size(const LWCOLLECTION *col, int relative, int precision)
411 {
412  int i = 0;
413  size_t size=0;
414  const LWGEOM *subgeom;
415 
416  for (i=0; i<col->ngeoms; i++)
417  {
418  subgeom = col->geoms[i];
419  size += assvg_geom_size(subgeom, relative, precision);
420  }
421 
422  if ( i ) /* We have some geometries, so add space for delimiters. */
423  size += sizeof(";") * --i;
424 
425  if (size == 0) size++; /* GEOMETRYCOLLECTION EMPTY, space for null terminator */
426 
427  return size;
428 }
429 
430 static size_t
431 assvg_collection_buf(const LWCOLLECTION *col, char *output, int relative, int precision)
432 {
433  int i;
434  char *ptr=output;
435  const LWGEOM *subgeom;
436 
437  /* EMPTY GEOMETRYCOLLECTION */
438  if (col->ngeoms == 0) *ptr = '\0';
439 
440  for (i=0; i<col->ngeoms; i++)
441  {
442  if (i) ptr += sprintf(ptr, ";");
443  subgeom = col->geoms[i];
444  ptr += assvg_geom_buf(subgeom, ptr, relative, precision);
445  }
446 
447  return (ptr - output);
448 }
449 
450 static char *
451 assvg_collection(const LWCOLLECTION *col, int relative, int precision)
452 {
453  char *output;
454  int size;
455 
456  size = assvg_collection_size(col, relative, precision);
457  output = lwalloc(size);
458  assvg_collection_buf(col, output, relative, precision);
459 
460  return output;
461 }
462 
463 
464 static size_t
465 assvg_geom_buf(const LWGEOM *geom, char *output, int relative, int precision)
466 {
467  int type = geom->type;
468  char *ptr=output;
469 
470  switch (type)
471  {
472  case POINTTYPE:
473  ptr += assvg_point_buf((LWPOINT*)geom, ptr, relative, precision);
474  break;
475 
476  case LINETYPE:
477  ptr += assvg_line_buf((LWLINE*)geom, ptr, relative, precision);
478  break;
479 
480  case POLYGONTYPE:
481  ptr += assvg_polygon_buf((LWPOLY*)geom, ptr, relative, precision);
482  break;
483 
484  case MULTIPOINTTYPE:
485  ptr += assvg_multipoint_buf((LWMPOINT*)geom, ptr, relative, precision);
486  break;
487 
488  case MULTILINETYPE:
489  ptr += assvg_multiline_buf((LWMLINE*)geom, ptr, relative, precision);
490  break;
491 
492  case MULTIPOLYGONTYPE:
493  ptr += assvg_multipolygon_buf((LWMPOLY*)geom, ptr, relative, precision);
494  break;
495 
496  default:
497  lwerror("assvg_geom_buf: '%s' geometry type not supported.",
498  lwtype_name(type));
499  }
500 
501  return (ptr-output);
502 }
503 
504 
505 static size_t
506 assvg_geom_size(const LWGEOM *geom, int relative, int precision)
507 {
508  int type = geom->type;
509  size_t size = 0;
510 
511  switch (type)
512  {
513  case POINTTYPE:
514  size = assvg_point_size((LWPOINT*)geom, relative, precision);
515  break;
516 
517  case LINETYPE:
518  size = assvg_line_size((LWLINE*)geom, relative, precision);
519  break;
520 
521  case POLYGONTYPE:
522  size = assvg_polygon_size((LWPOLY*)geom, relative, precision);
523  break;
524 
525  case MULTIPOINTTYPE:
526  size = assvg_multipoint_size((LWMPOINT*)geom, relative, precision);
527  break;
528 
529  case MULTILINETYPE:
530  size = assvg_multiline_size((LWMLINE*)geom, relative, precision);
531  break;
532 
533  case MULTIPOLYGONTYPE:
534  size = assvg_multipolygon_size((LWMPOLY*)geom, relative, precision);
535  break;
536 
537  default:
538  lwerror("assvg_geom_size: '%s' geometry type not supported.",
539  lwtype_name(type));
540  }
541 
542  return size;
543 }
544 
545 
546 static size_t
547 pointArray_svg_rel(POINTARRAY *pa, char *output, int close_ring, int precision)
548 {
549  int i, end;
550  char *ptr;
553  const POINT2D *pt;
554 
555  double f = 1.0;
556  double dx, dy, x, y, accum_x, accum_y;
557 
558  ptr = output;
559 
560  if (precision >= 0)
561  {
562  f = pow(10, precision);
563  }
564 
565  if (close_ring) end = pa->npoints;
566  else end = pa->npoints - 1;
567 
568  /* Starting point */
569  pt = getPoint2d_cp(pa, 0);
570 
571  x = round(pt->x*f)/f;
572  y = round(pt->y*f)/f;
573 
574  if (fabs(x) < OUT_MAX_DOUBLE)
575  sprintf(sx, "%.*f", precision, x);
576  else
577  sprintf(sx, "%g", x);
579 
580  if (fabs(y) < OUT_MAX_DOUBLE)
581  sprintf(sy, "%.*f", precision, fabs(y) ? y * -1 : y);
582  else
583  sprintf(sy, "%g", fabs(y) ? y * -1 : y);
585 
586  ptr += sprintf(ptr,"%s %s l", sx, sy);
587 
588  /* accum */
589  accum_x = x;
590  accum_y = y;
591 
592  /* All the following ones */
593  for (i=1 ; i < end ; i++)
594  {
595  // lpt = pt;
596 
597  pt = getPoint2d_cp(pa, i);
598 
599  x = round(pt->x*f)/f;
600  y = round(pt->y*f)/f;
601  dx = x - accum_x;
602  dy = y - accum_y;
603 
604  if (fabs(dx) < OUT_MAX_DOUBLE)
605  sprintf(sx, "%.*f", precision, dx);
606  else
607  sprintf(sx, "%g", dx);
609 
610  /* SVG Y axis is reversed, an no need to transform 0 into -0 */
611  if (fabs(dy) < OUT_MAX_DOUBLE)
612  sprintf(sy, "%.*f", precision,
613  fabs(dy) ? dy * -1: dy);
614  else
615  sprintf(sy, "%g",
616  fabs(dy) ? dy * -1: dy);
618 
619  accum_x += dx;
620  accum_y += dy;
621 
622  ptr += sprintf(ptr," %s %s", sx, sy);
623  }
624 
625  return (ptr-output);
626 }
627 
628 
632 static size_t
633 pointArray_svg_abs(POINTARRAY *pa, char *output, int close_ring, int precision)
634 {
635  int i, end;
636  char *ptr;
639  POINT2D pt;
640 
641  ptr = output;
642 
643  if (close_ring) end = pa->npoints;
644  else end = pa->npoints - 1;
645 
646  for (i=0 ; i < end ; i++)
647  {
648  getPoint2d_p(pa, i, &pt);
649 
650  if (fabs(pt.x) < OUT_MAX_DOUBLE)
651  sprintf(x, "%.*f", precision, pt.x);
652  else
653  sprintf(x, "%g", pt.x);
655 
656  /* SVG Y axis is reversed, an no need to transform 0 into -0 */
657  if (fabs(pt.y) < OUT_MAX_DOUBLE)
658  sprintf(y, "%.*f", precision, fabs(pt.y) ? pt.y * -1:pt.y);
659  else
660  sprintf(y, "%g", fabs(pt.y) ? pt.y * -1:pt.y);
662 
663  if (i == 1) ptr += sprintf(ptr, " L ");
664  else if (i) ptr += sprintf(ptr, " ");
665  ptr += sprintf(ptr,"%s %s", x, y);
666  }
667 
668  return (ptr-output);
669 }
670 
671 
675 static size_t
676 pointArray_svg_size(POINTARRAY *pa, int precision)
677 {
678  return (OUT_MAX_DIGS_DOUBLE + precision + sizeof(" "))
679  * 2 * pa->npoints + sizeof(" L ");
680 }
#define LINETYPE
Definition: liblwgeom.h:61
static size_t assvg_line_buf(const LWLINE *line, char *output, int relative, int precision)
Definition: lwout_svg.c:164
static size_t pointArray_svg_rel(POINTARRAY *pa, char *output, int close_ring, int precision)
Definition: lwout_svg.c:547
int npoints
Definition: liblwgeom.h:327
#define OUT_MAX_DOUBLE_PRECISION
void trim_trailing_zeros(char *num)
Definition: lwutil.c:200
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
static char * assvg_multipoint(const LWMPOINT *mpoint, int relative, int precision)
Definition: lwout_svg.c:288
static size_t assvg_polygon_buf(const LWPOLY *poly, char *output, int relative, int precision)
Definition: lwout_svg.c:210
static size_t assvg_multipoint_buf(const LWMPOINT *mpoint, char *output, int relative, int precision)
Definition: lwout_svg.c:271
char * lwgeom_to_svg(const LWGEOM *geom, int precision, int relative)
Takes a GEOMETRY and returns a SVG representation.
Definition: lwout_svg.c:43
POINTARRAY * point
Definition: liblwgeom.h:367
int ngeoms
Definition: liblwgeom.h:437
static size_t assvg_line_size(const LWLINE *line, int relative, int precision)
Line Geometry.
Definition: lwout_svg.c:153
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
double x
Definition: liblwgeom.h:284
static char * assvg_multiline(const LWMLINE *mline, int relative, int precision)
Definition: lwout_svg.c:340
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
static size_t assvg_multiline_size(const LWMLINE *mline, int relative, int precision)
Multiline Geometry.
Definition: lwout_svg.c:306
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
Definition: lwgeom_api.c:458
static char * assvg_multipolygon(const LWMPOLY *mpoly, int relative, int precision)
Definition: lwout_svg.c:392
static size_t assvg_polygon_size(const LWPOLY *poly, int relative, int precision)
Polygon Geometry.
Definition: lwout_svg.c:197
LWPOLY ** geoms
Definition: liblwgeom.h:452
LWGEOM ** geoms
Definition: liblwgeom.h:465
static size_t assvg_multiline_buf(const LWMLINE *mline, char *output, int relative, int precision)
Definition: lwout_svg.c:323
static size_t assvg_multipoint_size(const LWMPOINT *mpoint, int relative, int precision)
Multipoint Geometry.
Definition: lwout_svg.c:254
POINTARRAY ** rings
Definition: liblwgeom.h:413
static size_t assvg_multipolygon_size(const LWMPOLY *mpoly, int relative, int precision)
Definition: lwout_svg.c:358
LWPOINT ** geoms
Definition: liblwgeom.h:426
int nrings
Definition: liblwgeom.h:411
static size_t pointArray_svg_size(POINTARRAY *pa, int precision)
Returns maximum size of rendered pointarray in bytes.
Definition: lwout_svg.c:676
double y
Definition: liblwgeom.h:284
static char * assvg_collection(const LWCOLLECTION *col, int relative, int precision)
Definition: lwout_svg.c:451
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:434
tuple x
Definition: pixval.py:53
static char * assvg_line(const LWLINE *line, int relative, int precision)
Definition: lwout_svg.c:179
int ngeoms
Definition: liblwgeom.h:450
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define OUT_MAX_DOUBLE
LWLINE ** geoms
Definition: liblwgeom.h:439
static size_t assvg_collection_buf(const LWCOLLECTION *col, char *output, int relative, int precision)
Definition: lwout_svg.c:431
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
static size_t assvg_point_buf(const LWPOINT *point, char *output, int circle, int precision)
Definition: lwout_svg.c:106
static char * assvg_point(const LWPOINT *point, int relative, int precision)
Definition: lwout_svg.c:135
uint8_t type
Definition: liblwgeom.h:352
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
static size_t assvg_collection_size(const LWCOLLECTION *col, int relative, int precision)
Collection Geometry.
Definition: lwout_svg.c:410
static size_t assvg_multipolygon_buf(const LWMPOLY *mpoly, char *output, int relative, int precision)
Definition: lwout_svg.c:375
void * lwalloc(size_t size)
Definition: lwutil.c:175
#define OUT_MAX_DIGS_DOUBLE
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1229
static char * assvg_polygon(const LWPOLY *poly, int relative, int precision)
Definition: lwout_svg.c:236
#define MULTILINETYPE
Definition: liblwgeom.h:64
static size_t assvg_point_size(const LWPOINT *point, int circle, int precision)
Point Geometry.
Definition: lwout_svg.c:94
int ngeoms
Definition: liblwgeom.h:424
tuple y
Definition: pixval.py:54
static size_t assvg_geom_size(const LWGEOM *geom, int relative, int precision)
Definition: lwout_svg.c:506
#define COLLECTIONTYPE
Definition: liblwgeom.h:66
POINTARRAY * points
Definition: liblwgeom.h:378
static size_t assvg_geom_buf(const LWGEOM *geom, char *output, int relative, int precision)
Definition: lwout_svg.c:465