PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t assvg_geom_size ( const LWGEOM geom,
int  relative,
int  precision 
)
static

Definition at line 506 of file lwout_svg.c.

References assvg_line_size(), assvg_multiline_size(), assvg_multipoint_size(), assvg_multipolygon_size(), assvg_point_size(), assvg_polygon_size(), LINETYPE, lwerror(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, and LWGEOM::type.

Referenced by assvg_collection_size().

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 }
#define LINETYPE
Definition: liblwgeom.h:61
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
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
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
static size_t assvg_polygon_size(const LWPOLY *poly, int relative, int precision)
Polygon Geometry.
Definition: lwout_svg.c:197
static size_t assvg_multipoint_size(const LWMPOINT *mpoint, int relative, int precision)
Multipoint Geometry.
Definition: lwout_svg.c:254
static size_t assvg_multipolygon_size(const LWMPOLY *mpoly, int relative, int precision)
Definition: lwout_svg.c:358
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
#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

Here is the call graph for this function:

Here is the caller graph for this function: