PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ asgeojson_point_buf()

static size_t asgeojson_point_buf ( const LWPOINT point,
const char *  srs,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 185 of file lwout_geojson.c.

186 {
187  char *ptr = output;
188 
189  ptr += sprintf(ptr, "{\"type\":\"Point\",");
190  if (srs) ptr += asgeojson_srs_buf(ptr, srs);
191  if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(point->flags), precision);
192 
193  ptr += sprintf(ptr, "\"coordinates\":");
194  if ( lwpoint_is_empty(point) )
195  ptr += sprintf(ptr, "[]");
196  ptr += pointArray_to_geojson(point->point, ptr, precision);
197  ptr += sprintf(ptr, "}");
198 
199  return (ptr-output);
200 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:179
int lwpoint_is_empty(const LWPOINT *point)
static size_t asgeojson_srs_buf(char *output, const char *srs)
static size_t pointArray_to_geojson(POINTARRAY *pa, char *buf, int precision)
static size_t asgeojson_bbox_buf(char *output, GBOX *bbox, int hasz, int precision)
POINTARRAY * point
Definition: liblwgeom.h:485
lwflags_t flags
Definition: liblwgeom.h:487

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

Referenced by asgeojson_point().

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