PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t asgeojson_multipoint_buf ( const LWMPOINT mpoint,
char *  srs,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 337 of file lwout_geojson.c.

References asgeojson_bbox_buf(), asgeojson_srs_buf(), LWMPOINT::flags, FLAGS_GET_Z, LWMPOINT::geoms, LWMPOINT::ngeoms, LWPOINT::point, and pointArray_to_geojson().

Referenced by asgeojson_geom_buf(), and asgeojson_multipoint().

338 {
339  LWPOINT *point;
340  int i;
341  char *ptr=output;
342 
343  ptr += sprintf(ptr, "{\"type\":\"MultiPoint\",");
344  if (srs) ptr += asgeojson_srs_buf(ptr, srs);
345  if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(mpoint->flags), precision);
346  ptr += sprintf(ptr, "\"coordinates\":[");
347 
348  for (i=0; i<mpoint->ngeoms; i++)
349  {
350  if (i) ptr += sprintf(ptr, ",");
351  point = mpoint->geoms[i];
352  ptr += pointArray_to_geojson(point->point, ptr, precision);
353  }
354  ptr += sprintf(ptr, "]}");
355 
356  return (ptr - output);
357 }
static size_t asgeojson_srs_buf(char *output, char *srs)
Definition: lwout_geojson.c:93
uint8_t flags
Definition: liblwgeom.h:449
POINTARRAY * point
Definition: liblwgeom.h:395
uint8_t precision
Definition: cu_in_twkb.c:25
LWPOINT ** geoms
Definition: liblwgeom.h:454
static size_t asgeojson_bbox_buf(char *output, GBOX *bbox, int hasz, int precision)
static size_t pointArray_to_geojson(POINTARRAY *pa, char *buf, int precision)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
int ngeoms
Definition: liblwgeom.h:452

Here is the call graph for this function:

Here is the caller graph for this function: