PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t asgeojson_point_buf ( const LWPOINT point,
char *  srs,
char *  output,
GBOX bbox,
int  precision 

Definition at line 169 of file lwout_geojson.c.

References asgeojson_bbox_buf(), asgeojson_srs_buf(), LWPOINT::flags, FLAGS_GET_Z, lwpoint_is_empty(), LWPOINT::point, and pointArray_to_geojson().

Referenced by asgeojson_geom_buf(), and asgeojson_point().

170 {
171  char *ptr = output;
173  ptr += sprintf(ptr, "{\"type\":\"Point\",");
174  if (srs) ptr += asgeojson_srs_buf(ptr, srs);
175  if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(point->flags), precision);
177  ptr += sprintf(ptr, "\"coordinates\":");
178  if ( lwpoint_is_empty(point) )
179  ptr += sprintf(ptr, "[]");
180  ptr += pointArray_to_geojson(point->point, ptr, precision);
181  ptr += sprintf(ptr, "}");
183  return (ptr-output);
184 }
static size_t asgeojson_srs_buf(char *output, char *srs)
Definition: lwout_geojson.c:93
Definition: liblwgeom.h:395
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:392
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:260

Here is the call graph for this function:

Here is the caller graph for this function: