PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ assvg_geom_size()

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

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

510 {
511  int type = geom->type;
512  size_t size = 0;
513 
514  switch (type)
515  {
516  case POINTTYPE:
517  size = assvg_point_size((LWPOINT*)geom, relative, precision);
518  break;
519 
520  case LINETYPE:
521  size = assvg_line_size((LWLINE*)geom, relative, precision);
522  break;
523 
524  case POLYGONTYPE:
525  size = assvg_polygon_size((LWPOLY*)geom, relative, precision);
526  break;
527 
528  case MULTIPOINTTYPE:
529  size = assvg_multipoint_size((LWMPOINT*)geom, relative, precision);
530  break;
531 
532  case MULTILINETYPE:
533  size = assvg_multiline_size((LWMLINE*)geom, relative, precision);
534  break;
535 
536  case MULTIPOLYGONTYPE:
537  size = assvg_multipolygon_size((LWMPOLY*)geom, relative, precision);
538  break;
539 
540  default:
541  lwerror("assvg_geom_size: '%s' geometry type not supported.",
542  lwtype_name(type));
543  }
544 
545  return size;
546 }
#define LINETYPE
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
static size_t assvg_point_size(__attribute__((__unused__)) const LWPOINT *point, int circle, int precision)
Point Geometry.
Definition: lwout_svg.c:107
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
static size_t assvg_multiline_size(const LWMLINE *mline, int relative, int precision)
Multiline Geometry.
Definition: lwout_svg.c:309
static size_t assvg_multipoint_size(const LWMPOINT *mpoint, int relative, int precision)
Multipoint Geometry.
Definition: lwout_svg.c:257
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:361
static size_t assvg_line_size(const LWLINE *line, __attribute__((__unused__)) int relative, int precision)
Line Geometry.
Definition: lwout_svg.c:156
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
static size_t assvg_polygon_size(const LWPOLY *poly, __attribute__((__unused__)) int relative, int precision)
Polygon Geometry.
Definition: lwout_svg.c:200
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
Here is the call graph for this function:
Here is the caller graph for this function: