PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgeojson_multiline_size ( const LWMLINE mline,
char *  srs,
GBOX bbox,
int  precision 
)
static

Multiline Geometry.

Definition at line 380 of file lwout_geojson.c.

References asgeojson_bbox_size(), asgeojson_srs_size(), LWMLINE::flags, FLAGS_GET_Z, LWMLINE::geoms, LWMLINE::ngeoms, pointArray_geojson_size(), and LWLINE::points.

Referenced by asgeojson_geom_size(), and asgeojson_multiline().

381 {
382  LWLINE * line;
383  int size;
384  int i;
385 
386  size = sizeof("{'type':'MultiLineString',");
387  if (srs) size += asgeojson_srs_size(srs);
388  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(mline->flags), precision);
389  size += sizeof("'coordinates':[]}");
390 
391  for (i=0 ; i<mline->ngeoms; i++)
392  {
393  line = mline->geoms[i];
394  size += pointArray_geojson_size(line->points, precision);
395  size += sizeof("[]");
396  }
397  size += sizeof(",") * i;
398 
399  return size;
400 }
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
int ngeoms
Definition: liblwgeom.h:437
uint8_t flags
Definition: liblwgeom.h:434
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
LWLINE ** geoms
Definition: liblwgeom.h:439
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.
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: