PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ asgeojson_multipoint_size()

static size_t asgeojson_multipoint_size ( const LWMPOINT mpoint,
char *  srs,
GBOX bbox,
int  precision 
)
static

Multipoint Geometry.

Definition at line 329 of file lwout_geojson.c.

References asgeojson_bbox_size(), asgeojson_srs_size(), LWMPOINT::flags, FLAGS_GET_Z, LWMPOINT::geoms, LWMPOINT::ngeoms, LWPOINT::point, and pointArray_geojson_size().

Referenced by asgeojson_geom_size(), and asgeojson_multipoint().

330 {
331  LWPOINT * point;
332  int size;
333  uint32_t i;
334 
335  size = sizeof("{'type':'MultiPoint',");
336  if (srs) size += asgeojson_srs_size(srs);
337  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(mpoint->flags), precision);
338  size += sizeof("'coordinates':[]}");
339 
340  for (i=0; i<mpoint->ngeoms; i++)
341  {
342  point = mpoint->geoms[i];
343  size += pointArray_geojson_size(point->point, precision);
344  }
345  size += sizeof(",") * i;
346 
347  return size;
348 }
uint32_t ngeoms
Definition: liblwgeom.h:470
uint8_t flags
Definition: liblwgeom.h:467
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
POINTARRAY * point
Definition: liblwgeom.h:413
unsigned int uint32_t
Definition: uthash.h:78
uint8_t precision
Definition: cu_in_twkb.c:25
LWPOINT ** geoms
Definition: liblwgeom.h:472
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:139
static size_t asgeojson_srs_size(char *srs)
Handle SRS.
Definition: lwout_geojson.c:95
static size_t pointArray_geojson_size(POINTARRAY *pa, int precision)
Returns maximum size of rendered pointarray in bytes.
Here is the call graph for this function:
Here is the caller graph for this function: