PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgeojson_multipoint()

static void asgeojson_multipoint ( stringbuffer_t sb,
const LWMPOINT mpoint,
const geojson_opts opts 
)
static

Multipoint Geometry.

Definition at line 236 of file lwout_geojson.c.

237 {
238  uint32_t i, ngeoms = mpoint->ngeoms;
239  stringbuffer_append_len(sb, "{\"type\":\"MultiPoint\",", 21);
240  asgeojson_srs(sb, opts);
241  asgeojson_bbox(sb, opts);
242  stringbuffer_append_len(sb, "\"coordinates\":[", 15);
243 
244  if (lwgeom_is_empty((LWGEOM*)mpoint))
245  ngeoms = 0;
246 
247  for (i=0; i < ngeoms; i++)
248  {
249  if (i) stringbuffer_append_char(sb, ',');
250  asgeojson_point_coords(sb, mpoint->geoms[i], opts, geojson_untagged);
251  }
252  stringbuffer_append_len(sb, "]}", 2);
253  return;
254 }
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:203
static void asgeojson_srs(stringbuffer_t *sb, const geojson_opts *opts)
Definition: lwout_geojson.c:95
static void asgeojson_bbox(stringbuffer_t *sb, const geojson_opts *opts)
static void asgeojson_point_coords(stringbuffer_t *sb, const LWPOINT *point, const geojson_opts *opts, int tagged)
Point Geometry.
@ geojson_untagged
Definition: lwout_geojson.c:43
opts
Definition: ovdump.py:45
static void stringbuffer_append_char(stringbuffer_t *s, char c)
Definition: stringbuffer.h:119
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.
Definition: stringbuffer.h:93
uint32_t ngeoms
Definition: liblwgeom.h:538

References asgeojson_bbox(), asgeojson_point_coords(), asgeojson_srs(), geojson_untagged, LWMPOINT::geoms, lwgeom_is_empty(), LWMPOINT::ngeoms, ovdump::opts, 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: