PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asgeojson_line_buf()

static size_t asgeojson_line_buf ( const LWLINE line,
char *  srs,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 233 of file lwout_geojson.c.

234 {
235  char *ptr=output;
236 
237  ptr += sprintf(ptr, "{\"type\":\"LineString\",");
238  if (srs) ptr += asgeojson_srs_buf(ptr, srs);
239  if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(line->flags), precision);
240  ptr += sprintf(ptr, "\"coordinates\":[");
241  ptr += pointArray_to_geojson(line->points, ptr, precision);
242  ptr += sprintf(ptr, "]}");
243 
244  return (ptr-output);
245 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
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)
uint8_t flags
Definition: liblwgeom.h:422
POINTARRAY * points
Definition: liblwgeom.h:425

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

Referenced by asgeojson_geom_buf(), and asgeojson_line().

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