PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgeojson_collection_size ( const LWCOLLECTION col,
char *  srs,
GBOX bbox,
int  precision 
)
static

Collection Geometry.

Definition at line 525 of file lwout_geojson.c.

References asgeojson_bbox_size(), asgeojson_geom_size(), asgeojson_srs_size(), LWCOLLECTION::flags, FLAGS_GET_Z, LWCOLLECTION::geoms, and LWCOLLECTION::ngeoms.

Referenced by asgeojson_collection().

526 {
527  int i;
528  int size;
529  LWGEOM *subgeom;
530 
531  size = sizeof("{'type':'GeometryCollection',");
532  if (srs) size += asgeojson_srs_size(srs);
533  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(col->flags), precision);
534  size += sizeof("'geometries':");
535 
536  for (i=0; i<col->ngeoms; i++)
537  {
538  subgeom = col->geoms[i];
539  size += asgeojson_geom_size(subgeom, NULL, precision);
540  }
541  size += sizeof(",") * i;
542  size += sizeof("]}");
543 
544  return size;
545 }
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
uint8_t flags
Definition: liblwgeom.h:460
LWGEOM ** geoms
Definition: liblwgeom.h:465
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
static size_t asgeojson_geom_size(const LWGEOM *geom, GBOX *bbox, int precision)
static size_t asgeojson_srs_size(char *srs)
Handle SRS.
Definition: lwout_geojson.c:82

Here is the call graph for this function:

Here is the caller graph for this function: