PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ asgeojson_multipoint_buf()

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

Definition at line 404 of file lwout_geojson.c.

405{
406 LWPOINT *point;
407 uint32_t i;
408 char *ptr=output;
409
410 ptr += sprintf(ptr, "{\"type\":\"MultiPoint\",");
411 if (srs) ptr += asgeojson_srs_buf(ptr, srs);
412 if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(mpoint->flags), precision);
413 ptr += sprintf(ptr, "\"coordinates\":[");
414
415 for (i=0; i<mpoint->ngeoms; i++)
416 {
417 if (i) ptr += sprintf(ptr, ",");
418 point = mpoint->geoms[i];
419 ptr += pointArray_to_geojson(point->point, ptr, precision);
420 }
421 ptr += sprintf(ptr, "]}");
422
423 return (ptr - output);
424}
static uint8_t precision
Definition cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:179
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)
lwflags_t flags
Definition liblwgeom.h:521
uint32_t ngeoms
Definition liblwgeom.h:524
LWPOINT ** geoms
Definition liblwgeom.h:519
POINTARRAY * point
Definition liblwgeom.h:457

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: