PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgeojson_poly_coords()

static void asgeojson_poly_coords ( stringbuffer_t sb,
const LWPOLY poly,
const geojson_opts opts,
int  tagged 
)
static

Definition at line 152 of file lwout_geojson.c.

153 {
154  uint32_t i;
155  if (tagged == geojson_tagged) stringbuffer_append_len(sb, "\"coordinates\":", 14);
156  if (lwgeom_is_empty((LWGEOM*)poly))
157  stringbuffer_append_len(sb, "[]", 2);
158  else
159  {
160  stringbuffer_append_char(sb, '[');
161  for (i = 0; i < poly->nrings; i++)
162  {
163  if (i) stringbuffer_append_char(sb, ',');
164  pointArray_to_geojson(sb, poly->rings[i], opts);
165  }
166  stringbuffer_append_char(sb, ']');
167  }
168  return;
169 }
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 pointArray_to_geojson(stringbuffer_t *sb, const POINTARRAY *pa, const geojson_opts *opts)
Definition: lwout_geojson.c:76
@ geojson_tagged
Definition: lwout_geojson.c:42
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

References geojson_tagged, lwgeom_is_empty(), LWPOLY::nrings, ovdump::opts, pointArray_to_geojson(), LWPOLY::rings, stringbuffer_append_char(), and stringbuffer_append_len().

Referenced by asgeojson_multipolygon(), and asgeojson_poly().

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