PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgeojson_point_size ( const LWPOINT point,
char *  srs,
GBOX bbox,
int  precision 
)
static

Point Geometry.

Definition at line 152 of file lwout_geojson.c.

References asgeojson_bbox_size(), asgeojson_srs_size(), LWPOINT::flags, FLAGS_GET_Z, lwpoint_is_empty(), LWPOINT::point, and pointArray_geojson_size().

Referenced by asgeojson_geom_size(), and asgeojson_point().

153 {
154  int size;
155 
156  size = pointArray_geojson_size(point->point, precision);
157  size += sizeof("{'type':'Point',");
158  size += sizeof("'coordinates':}");
159 
160  if ( lwpoint_is_empty(point) )
161  size += 2; /* [] */
162 
163  if (srs) size += asgeojson_srs_size(srs);
164  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(point->flags), precision);
165 
166  return size;
167 }
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
POINTARRAY * point
Definition: liblwgeom.h:367
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
uint8_t flags
Definition: liblwgeom.h:364
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:258
static size_t asgeojson_srs_size(char *srs)
Handle SRS.
Definition: lwout_geojson.c:82
static size_t pointArray_geojson_size(POINTARRAY *pa, int precision)
Returns maximum size of rendered pointarray in bytes.

Here is the call graph for this function:

Here is the caller graph for this function: