PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asgeojson_multiline_size()

static size_t asgeojson_multiline_size ( const LWMLINE mline,
char *  srs,
GBOX bbox,
int  precision 
)
static

Multiline Geometry.

Definition at line 393 of file lwout_geojson.c.

394 {
395  LWLINE * line;
396  int size;
397  uint32_t i;
398 
399  size = sizeof("{'type':'MultiLineString',");
400  if (srs) size += asgeojson_srs_size(srs);
401  if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(mline->flags), precision);
402  size += sizeof("'coordinates':[]}");
403 
404  for (i=0 ; i<mline->ngeoms; i++)
405  {
406  line = mline->geoms[i];
407  size += pointArray_geojson_size(line->points, precision);
408  size += sizeof("[]");
409  }
410  size += sizeof(",") * i;
411 
412  return size;
413 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
static size_t pointArray_geojson_size(POINTARRAY *pa, int precision)
Returns maximum size of rendered pointarray in bytes.
static size_t asgeojson_srs_size(char *srs)
Handle SRS.
Definition: lwout_geojson.c:95
static size_t asgeojson_bbox_size(int hasz, int precision)
Handle Bbox.
POINTARRAY * points
Definition: liblwgeom.h:425
LWLINE ** geoms
Definition: liblwgeom.h:486
uint32_t ngeoms
Definition: liblwgeom.h:484
uint8_t flags
Definition: liblwgeom.h:481
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by asgeojson_geom_size(), and asgeojson_multiline().

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