PostGIS  2.2.8dev-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 315 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().

316 {
317  LWPOINT * point;
318  int size;
319  int i;
320 
321  size = sizeof("{'type':'MultiPoint',");
322  if (srs) size += asgeojson_srs_size(srs);
323  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(mpoint->flags), precision);
324  size += sizeof("'coordinates':[]}");
325 
326  for (i=0; i<mpoint->ngeoms; i++)
327  {
328  point = mpoint->geoms[i];
329  size += pointArray_geojson_size(point->point, precision);
330  }
331  size += sizeof(",") * i;
332 
333  return size;
334 }
uint8_t flags
Definition: liblwgeom.h:449
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
POINTARRAY * point
Definition: liblwgeom.h:395
uint8_t precision
Definition: cu_in_twkb.c:25
LWPOINT ** geoms
Definition: liblwgeom.h:454
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:124
static size_t asgeojson_srs_size(char *srs)
Handle SRS.
Definition: lwout_geojson.c:81
int ngeoms
Definition: liblwgeom.h:452
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: