PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ assvg_geom_size()

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

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

520 {
521  int type = geom->type;
522  size_t size = 0;
523 
524  switch (type)
525  {
526  case POINTTYPE:
527  size = assvg_point_size((LWPOINT*)geom, relative, precision);
528  break;
529 
530  case LINETYPE:
531  size = assvg_line_size((LWLINE*)geom, relative, precision);
532  break;
533 
534  case POLYGONTYPE:
535  size = assvg_polygon_size((LWPOLY*)geom, relative, precision);
536  break;
537 
538  case MULTIPOINTTYPE:
539  size = assvg_multipoint_size((LWMPOINT*)geom, relative, precision);
540  break;
541 
542  case MULTILINETYPE:
543  size = assvg_multiline_size((LWMLINE*)geom, relative, precision);
544  break;
545 
546  case MULTIPOLYGONTYPE:
547  size = assvg_multipolygon_size((LWMPOLY*)geom, relative, precision);
548  break;
549 
550  default:
551  lwerror("assvg_geom_size: '%s' geometry type not supported.",
552  lwtype_name(type));
553  }
554 
555  return size;
556 }
#define LINETYPE
Definition: liblwgeom.h:86
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
static size_t assvg_line_size(const LWLINE *line, int relative, int precision)
Line Geometry.
Definition: lwout_svg.c:166
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
static size_t assvg_multiline_size(const LWMLINE *mline, int relative, int precision)
Multiline Geometry.
Definition: lwout_svg.c:319
static size_t assvg_polygon_size(const LWPOLY *poly, int relative, int precision)
Polygon Geometry.
Definition: lwout_svg.c:210
static size_t assvg_multipoint_size(const LWMPOINT *mpoint, int relative, int precision)
Multipoint Geometry.
Definition: lwout_svg.c:267
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:371
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:89
static size_t assvg_point_size(const LWPOINT *point, int circle, int precision)
Point Geometry.
Definition: lwout_svg.c:107
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: