PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ pointArray_to_geojson()

static void pointArray_to_geojson ( stringbuffer_t sb,
const POINTARRAY pa,
const geojson_opts opts 
)
static

Definition at line 76 of file lwout_geojson.c.

77 {
78  if (!pa || pa->npoints == 0)
79  {
80  stringbuffer_append_len(sb, "[]", 2);
81  return;
82  }
83 
84  stringbuffer_append_char(sb, '[');
85  for (uint32_t i = 0; i < pa->npoints; i++)
86  {
87  if (i) stringbuffer_append_char(sb, ',');
88  coordinate_to_geojson(sb, pa, i, opts);
89  }
90  stringbuffer_append_char(sb, ']');
91  return;
92 }
static void coordinate_to_geojson(stringbuffer_t *sb, const POINTARRAY *pa, uint32_t i, const geojson_opts *opts)
Definition: lwout_geojson.c:51
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 npoints
Definition: liblwgeom.h:427

References coordinate_to_geojson(), POINTARRAY::npoints, ovdump::opts, stringbuffer_append_char(), and stringbuffer_append_len().

Referenced by asgeojson_line_coords(), asgeojson_poly_coords(), and asgeojson_triangle().

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