PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ asgeojson_geom_size()

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

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

601 {
602  int type = geom->type;
603  size_t size = 0;
604 
605  switch (type)
606  {
607  case POINTTYPE:
608  size = asgeojson_point_size((LWPOINT*)geom, NULL, bbox, precision);
609  break;
610 
611  case LINETYPE:
612  size = asgeojson_line_size((LWLINE*)geom, NULL, bbox, precision);
613  break;
614 
615  case POLYGONTYPE:
616  size = asgeojson_poly_size((LWPOLY*)geom, NULL, bbox, precision);
617  break;
618 
619  case MULTIPOINTTYPE:
620  size = asgeojson_multipoint_size((LWMPOINT*)geom, NULL, bbox, precision);
621  break;
622 
623  case MULTILINETYPE:
624  size = asgeojson_multiline_size((LWMLINE*)geom, NULL, bbox, precision);
625  break;
626 
627  case MULTIPOLYGONTYPE:
628  size = asgeojson_multipolygon_size((LWMPOLY*)geom, NULL, bbox, precision);
629  break;
630 
631  default:
632  lwerror("GeoJson: geometry not supported.");
633  }
634 
635  return size;
636 }
#define LINETYPE
Definition: liblwgeom.h:86
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
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:90
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:85
uint8_t type
Definition: liblwgeom.h:396
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:89
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:190
Here is the call graph for this function:
Here is the caller graph for this function: