PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asgeojson_collection_size()

static size_t asgeojson_collection_size ( const LWCOLLECTION col,
char *  srs,
GBOX bbox,
int  precision 
)
static

Collection Geometry.

Definition at line 538 of file lwout_geojson.c.

539 {
540  uint32_t i;
541  size_t size;
542  LWGEOM *subgeom;
543 
544  size = sizeof("{'type':'GeometryCollection',");
545  if (srs) size += asgeojson_srs_size(srs);
546  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(col->flags), precision);
547  size += sizeof("'geometries':");
548 
549  for (i=0; i<col->ngeoms; i++)
550  {
551  subgeom = col->geoms[i];
552  size += asgeojson_geom_size(subgeom, NULL, precision);
553  }
554  size += sizeof(",") * i;
555  size += sizeof("]}");
556 
557  return size;
558 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
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:95
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
uint32_t ngeoms
Definition: liblwgeom.h:510
uint8_t flags
Definition: liblwgeom.h:507
LWGEOM ** geoms
Definition: liblwgeom.h:512
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by asgeojson_collection().

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