PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ asgeojson_point_size()

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

Point Geometry.

Definition at line 165 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().

166 {
167  int size;
168 
169  size = pointArray_geojson_size(point->point, precision);
170  size += sizeof("{'type':'Point',");
171  size += sizeof("'coordinates':}");
172 
173  if ( lwpoint_is_empty(point) )
174  size += 2; /* [] */
175 
176  if (srs) size += asgeojson_srs_size(srs);
177  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(point->flags), precision);
178 
179  return size;
180 }
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
POINTARRAY * point
Definition: liblwgeom.h:413
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
uint8_t flags
Definition: liblwgeom.h:410
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:291
static size_t asgeojson_srs_size(char *srs)
Handle SRS.
Definition: lwout_geojson.c:95
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: