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

◆ asgeojson_collection_buf()

static size_t asgeojson_collection_buf ( const LWCOLLECTION col,
char *  srs,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 614 of file lwout_geojson.c.

615{
616 uint32_t i;
617 char *ptr=output;
618 LWGEOM *subgeom;
619
620 ptr += sprintf(ptr, "{\"type\":\"GeometryCollection\",");
621 if (srs) ptr += asgeojson_srs_buf(ptr, srs);
622 if (col->ngeoms && bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(col->flags), precision);
623 ptr += sprintf(ptr, "\"geometries\":[");
624
625 for (i=0; i<col->ngeoms; i++)
626 {
627 if (i) ptr += sprintf(ptr, ",");
628 subgeom = col->geoms[i];
629 ptr += asgeojson_geom_buf(subgeom, ptr, NULL, precision);
630 }
631
632 ptr += sprintf(ptr, "]}");
633
634 return (ptr - output);
635}
static uint8_t precision
Definition cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:179
static size_t asgeojson_geom_buf(const LWGEOM *geom, char *output, GBOX *bbox, 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:563
uint32_t ngeoms
Definition liblwgeom.h:566
LWGEOM ** geoms
Definition liblwgeom.h:561

References asgeojson_bbox_buf(), asgeojson_geom_buf(), asgeojson_srs_buf(), LWCOLLECTION::flags, FLAGS_GET_Z, LWCOLLECTION::geoms, LWCOLLECTION::ngeoms, and precision.

Referenced by asgeojson_collection().

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