PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asgeojson_geom_size()

static size_t asgeojson_geom_size ( const LWGEOM geom,
GBOX bbox,
int  precision 
)
static

Definition at line 586 of file lwout_geojson.c.

References asgeojson_line_size(), asgeojson_multiline_size(), asgeojson_multipoint_size(), asgeojson_multipolygon_size(), asgeojson_point_size(), asgeojson_poly_size(), LINETYPE, lwerror(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, ovdump::type, and LWGEOM::type.

Referenced by asgeojson_collection_size().

587 {
588  int type = geom->type;
589  size_t size = 0;
590 
591  switch (type)
592  {
593  case POINTTYPE:
594  size = asgeojson_point_size((LWPOINT*)geom, NULL, bbox, precision);
595  break;
596 
597  case LINETYPE:
598  size = asgeojson_line_size((LWLINE*)geom, NULL, bbox, precision);
599  break;
600 
601  case POLYGONTYPE:
602  size = asgeojson_poly_size((LWPOLY*)geom, NULL, bbox, precision);
603  break;
604 
605  case MULTIPOINTTYPE:
606  size = asgeojson_multipoint_size((LWMPOINT*)geom, NULL, bbox, precision);
607  break;
608 
609  case MULTILINETYPE:
610  size = asgeojson_multiline_size((LWMLINE*)geom, NULL, bbox, precision);
611  break;
612 
613  case MULTIPOLYGONTYPE:
614  size = asgeojson_multipolygon_size((LWMPOLY*)geom, NULL, bbox, precision);
615  break;
616 
617  default:
618  lwerror("GeoJson: geometry not supported.");
619  }
620 
621  return size;
622 }
#define LINETYPE
Definition: liblwgeom.h:71
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
static size_t asgeojson_multiline_size(const LWMLINE *mline, char *srs, GBOX *bbox, int precision)
Multiline Geometry.
uint8_t precision
Definition: cu_in_twkb.c:25
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
static size_t asgeojson_point_size(const LWPOINT *point, char *srs, GBOX *bbox, int precision)
Point Geometry.
static size_t asgeojson_multipolygon_size(const LWMPOLY *mpoly, char *srs, GBOX *bbox, int precision)
MultiPolygon Geometry.
static size_t asgeojson_multipoint_size(const LWMPOINT *mpoint, char *srs, GBOX *bbox, int precision)
Multipoint Geometry.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
type
Definition: ovdump.py:41
static size_t asgeojson_line_size(const LWLINE *line, char *srs, GBOX *bbox, int precision)
Line Geometry.
#define MULTILINETYPE
Definition: liblwgeom.h:74
static size_t asgeojson_poly_size(const LWPOLY *poly, char *srs, GBOX *bbox, int precision)
Polygon Geometry.
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: