PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t pointArray_geojson_size ( POINTARRAY pa,
int  precision 
)
static

Returns maximum size of rendered pointarray in bytes.

Definition at line 764 of file lwout_geojson.c.

References POINTARRAY::flags, FLAGS_NDIMS, POINTARRAY::npoints, OUT_MAX_DIGS_DOUBLE, and OUT_MAX_DOUBLE_PRECISION.

Referenced by asgeojson_line_size(), asgeojson_multiline_size(), asgeojson_multipoint_size(), asgeojson_multipolygon_size(), asgeojson_point_size(), and asgeojson_poly_size().

765 {
766  assert ( precision <= OUT_MAX_DOUBLE_PRECISION );
767  if (FLAGS_NDIMS(pa->flags) == 2)
768  return (OUT_MAX_DIGS_DOUBLE + precision + sizeof(","))
769  * 2 * pa->npoints + sizeof(",[]");
770 
771  return (OUT_MAX_DIGS_DOUBLE + precision + sizeof(",,"))
772  * 3 * pa->npoints + sizeof(",[]");
773 }
int npoints
Definition: liblwgeom.h:355
#define OUT_MAX_DOUBLE_PRECISION
uint8_t flags
Definition: liblwgeom.h:353
uint8_t precision
Definition: cu_in_twkb.c:25
#define OUT_MAX_DIGS_DOUBLE
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:136

Here is the caller graph for this function: