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

◆ asgeojson_multipolygon()

static void asgeojson_multipolygon ( stringbuffer_t sb,
const LWMPOLY mpoly,
const geojson_opts opts 
)
static

Definition at line 283 of file lwout_geojson.c.

284{
285 uint32_t i, ngeoms = mpoly->ngeoms;
286
287 stringbuffer_append_len(sb, "{\"type\":\"MultiPolygon\",", 23);
288 asgeojson_srs(sb, opts);
289 asgeojson_bbox(sb, opts);
290 stringbuffer_append_len(sb, "\"coordinates\":[", 15);
291
292 if (lwgeom_is_empty((LWGEOM*)mpoly))
293 ngeoms = 0;
294
295 for (i=0; i < ngeoms; i++)
296 {
297 if (i) stringbuffer_append_char(sb, ',');
298 asgeojson_poly_coords(sb, mpoly->geoms[i], opts, geojson_untagged);
299 }
300 stringbuffer_append_len(sb, "]}", 2);
301 return;
302}
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition lwinline.h:199
static void asgeojson_srs(stringbuffer_t *sb, const geojson_opts *opts)
static void asgeojson_bbox(stringbuffer_t *sb, const geojson_opts *opts)
@ geojson_untagged
static void asgeojson_poly_coords(stringbuffer_t *sb, const LWPOLY *poly, const geojson_opts *opts, int tagged)
static void stringbuffer_append_char(stringbuffer_t *s, char c)
static void stringbuffer_append_len(stringbuffer_t *s, const char *a, size_t alen)
Append the specified string to the stringbuffer_t using known length.
uint32_t ngeoms
Definition liblwgeom.h:566

References asgeojson_bbox(), asgeojson_poly_coords(), asgeojson_srs(), geojson_untagged, LWMPOLY::geoms, lwgeom_is_empty(), LWMPOLY::ngeoms, stringbuffer_append_char(), and stringbuffer_append_len().

Referenced by asgeojson_geometry().

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