PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ assvg_geom_size()

static size_t assvg_geom_size ( const LWGEOM geom,
int  relative,
int  precision 
)
static

Definition at line 505 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, ovdump::type, and LWGEOM::type.

Referenced by assvg_collection_size().

506 {
507  int type = geom->type;
508  size_t size = 0;
509 
510  switch (type)
511  {
512  case POINTTYPE:
513  size = assvg_point_size((LWPOINT*)geom, relative, precision);
514  break;
515 
516  case LINETYPE:
517  size = assvg_line_size((LWLINE*)geom, relative, precision);
518  break;
519 
520  case POLYGONTYPE:
521  size = assvg_polygon_size((LWPOLY*)geom, relative, precision);
522  break;
523 
524  case MULTIPOINTTYPE:
525  size = assvg_multipoint_size((LWMPOINT*)geom, relative, precision);
526  break;
527 
528  case MULTILINETYPE:
529  size = assvg_multiline_size((LWMLINE*)geom, relative, precision);
530  break;
531 
532  case MULTIPOLYGONTYPE:
533  size = assvg_multipolygon_size((LWMPOLY*)geom, relative, precision);
534  break;
535 
536  default:
537  lwerror("assvg_geom_size: '%s' geometry type not supported.",
538  lwtype_name(type));
539  }
540 
541  return size;
542 }
#define LINETYPE
Definition: liblwgeom.h:71
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
static size_t assvg_line_size(const LWLINE *line, int relative, int precision)
Line Geometry.
Definition: lwout_svg.c:152
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
static size_t assvg_multiline_size(const LWMLINE *mline, int relative, int precision)
Multiline Geometry.
Definition: lwout_svg.c:305
static size_t assvg_polygon_size(const LWPOLY *poly, int relative, int precision)
Polygon Geometry.
Definition: lwout_svg.c:196
static size_t assvg_multipoint_size(const LWMPOINT *mpoint, int relative, int precision)
Multipoint Geometry.
Definition: lwout_svg.c:253
uint8_t precision
Definition: cu_in_twkb.c:25
static size_t assvg_multipolygon_size(const LWMPOLY *mpoly, int relative, int precision)
Definition: lwout_svg.c:357
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:74
static size_t assvg_point_size(const LWPOINT *point, int circle, int precision)
Point Geometry.
Definition: lwout_svg.c:93
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
Here is the call graph for this function:
Here is the caller graph for this function: