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

◆ 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 {
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 }
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:199
static void pointArray_to_geojson(stringbuffer_t *sb, const POINTARRAY *pa, const geojson_opts *opts)
@ geojson_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.

References geojson_tagged, lwgeom_is_empty(), LWPOLY::nrings, 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: