PostGIS  2.5.7dev-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.

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 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
static size_t asgeojson_multiline_size(const LWMLINE *mline, char *srs, GBOX *bbox, int precision)
Multiline Geometry.
static size_t asgeojson_multipoint_size(const LWMPOINT *mpoint, char *srs, GBOX *bbox, int precision)
Multipoint Geometry.
static size_t asgeojson_line_size(const LWLINE *line, char *srs, GBOX *bbox, int precision)
Line Geometry.
static size_t asgeojson_poly_size(const LWPOLY *poly, char *srs, GBOX *bbox, int precision)
Polygon Geometry.
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.
type
Definition: ovdump.py:41
uint8_t type
Definition: liblwgeom.h:399

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, precision, LWGEOM::type, and ovdump::type.

Referenced by asgeojson_collection_size().

Here is the call graph for this function:
Here is the caller graph for this function: