PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgeojson_geom_size ( const LWGEOM geom,
GBOX bbox,
int  precision 
)
static

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

Referenced by asgeojson_collection_size().

588 {
589  int type = geom->type;
590  size_t size = 0;
591 
592  switch (type)
593  {
594  case POINTTYPE:
595  size = asgeojson_point_size((LWPOINT*)geom, NULL, bbox, precision);
596  break;
597 
598  case LINETYPE:
599  size = asgeojson_line_size((LWLINE*)geom, NULL, bbox, precision);
600  break;
601 
602  case POLYGONTYPE:
603  size = asgeojson_poly_size((LWPOLY*)geom, NULL, bbox, precision);
604  break;
605 
606  case MULTIPOINTTYPE:
607  size = asgeojson_multipoint_size((LWMPOINT*)geom, NULL, bbox, precision);
608  break;
609 
610  case MULTILINETYPE:
611  size = asgeojson_multiline_size((LWMLINE*)geom, NULL, bbox, precision);
612  break;
613 
614  case MULTIPOLYGONTYPE:
615  size = asgeojson_multipolygon_size((LWMPOLY*)geom, NULL, bbox, precision);
616  break;
617 
618  default:
619  lwerror("GeoJson: geometry not supported.");
620  }
621 
622  return size;
623 }
#define LINETYPE
Definition: liblwgeom.h:61
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
static size_t asgeojson_multiline_size(const LWMLINE *mline, char *srs, GBOX *bbox, int precision)
Multiline Geometry.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
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:60
uint8_t type
Definition: liblwgeom.h:352
static size_t asgeojson_line_size(const LWLINE *line, char *srs, GBOX *bbox, int precision)
Line Geometry.
#define MULTILINETYPE
Definition: liblwgeom.h:64
static size_t asgeojson_poly_size(const LWPOLY *poly, char *srs, GBOX *bbox, int precision)
Polygon Geometry.

Here is the call graph for this function:

Here is the caller graph for this function: