PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgeojson_triangle()

static void asgeojson_triangle ( stringbuffer_t sb,
const LWTRIANGLE tri,
const geojson_opts opts 
)
static

Triangle Geometry.

Definition at line 189 of file lwout_geojson.c.

190 {
191  stringbuffer_append_len(sb, "{\"type\":\"Polygon\",", 18);
192  asgeojson_srs(sb, opts);
193  asgeojson_bbox(sb, opts);
194  stringbuffer_append_len(sb, "\"coordinates\":[", 15);
195  if (lwtriangle_is_empty(tri))
196  stringbuffer_append_len(sb, "[]", 2);
197  else
198  pointArray_to_geojson(sb, tri->points, opts);
199  stringbuffer_append_len(sb, "]}", 2);
200  return;
201 }
int lwtriangle_is_empty(const LWTRIANGLE *triangle)
static void pointArray_to_geojson(stringbuffer_t *sb, const POINTARRAY *pa, const geojson_opts *opts)
Definition: lwout_geojson.c:76
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)
opts
Definition: ovdump.py:45
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
POINTARRAY * points
Definition: liblwgeom.h:495

References asgeojson_bbox(), asgeojson_srs(), lwtriangle_is_empty(), ovdump::opts, pointArray_to_geojson(), LWTRIANGLE::points, and stringbuffer_append_len().

Referenced by asgeojson_geometry().

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