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

◆ asgeojson_triangle_buf()

static size_t asgeojson_triangle_buf ( const LWTRIANGLE tri,
char *  srs,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 237 of file lwout_geojson.c.

238{
239 char *ptr = output;
240
241 ptr += sprintf(ptr, "{\"type\":\"Polygon\",");
242 if (srs)
243 ptr += asgeojson_srs_buf(ptr, srs);
244 if (bbox)
245 ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(tri->flags), precision);
246 ptr += sprintf(ptr, "\"coordinates\":[[");
247 ptr += pointArray_to_geojson(tri->points, ptr, precision);
248 ptr += sprintf(ptr, "]]}");
249
250 return (ptr - output);
251}
static uint8_t precision
Definition cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:179
static size_t pointArray_to_geojson(POINTARRAY *pa, char *buf, int precision)
static size_t asgeojson_srs_buf(char *output, char *srs)
static size_t asgeojson_bbox_buf(char *output, GBOX *bbox, int hasz, int precision)
lwflags_t flags
Definition liblwgeom.h:483
POINTARRAY * points
Definition liblwgeom.h:481

References asgeojson_bbox_buf(), asgeojson_srs_buf(), LWTRIANGLE::flags, FLAGS_GET_Z, pointArray_to_geojson(), LWTRIANGLE::points, and precision.

Referenced by asgeojson_geom_buf(), and asgeojson_triangle().

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