PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asgeojson_multipoint_buf()

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

Definition at line 351 of file lwout_geojson.c.

352 {
353  LWPOINT *point;
354  uint32_t i;
355  char *ptr=output;
356 
357  ptr += sprintf(ptr, "{\"type\":\"MultiPoint\",");
358  if (srs) ptr += asgeojson_srs_buf(ptr, srs);
359  if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(mpoint->flags), precision);
360  ptr += sprintf(ptr, "\"coordinates\":[");
361 
362  for (i=0; i<mpoint->ngeoms; i++)
363  {
364  if (i) ptr += sprintf(ptr, ",");
365  point = mpoint->geoms[i];
366  ptr += pointArray_to_geojson(point->point, ptr, precision);
367  }
368  ptr += sprintf(ptr, "]}");
369 
370  return (ptr - output);
371 }
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 pointArray_to_geojson(POINTARRAY *pa, char *buf, int precision)
static size_t asgeojson_srs_buf(char *output, char *srs)
static size_t asgeojson_bbox_buf(char *output, GBOX *bbox, int hasz, int precision)
uint8_t flags
Definition: liblwgeom.h:468
uint32_t ngeoms
Definition: liblwgeom.h:471
LWPOINT ** geoms
Definition: liblwgeom.h:473
POINTARRAY * point
Definition: liblwgeom.h:414
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by asgeojson_geom_buf(), and asgeojson_multipoint().

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