PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asgeojson_line_buf()

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

Definition at line 219 of file lwout_geojson.c.

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

Referenced by asgeojson_geom_buf(), and asgeojson_line().

220 {
221  char *ptr=output;
223  ptr += sprintf(ptr, "{\"type\":\"LineString\",");
224  if (srs) ptr += asgeojson_srs_buf(ptr, srs);
225  if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(line->flags), precision);
226  ptr += sprintf(ptr, "\"coordinates\":[");
227  ptr += pointArray_to_geojson(line->points, ptr, precision);
228  ptr += sprintf(ptr, "]}");
230  return (ptr-output);
231 }
static size_t asgeojson_srs_buf(char *output, char *srs)
Definition: lwout_geojson.c:93
uint8_t precision
Definition: cu_in_twkb.c:25
static size_t asgeojson_bbox_buf(char *output, GBOX *bbox, int hasz, int precision)
static size_t pointArray_to_geojson(POINTARRAY *pa, char *buf, int precision)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
uint8_t flags
Definition: liblwgeom.h:403
Definition: liblwgeom.h:406
Here is the call graph for this function:
Here is the caller graph for this function: