PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asgml3_multi_size()

static size_t asgml3_multi_size ( const LWCOLLECTION col,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1391 of file lwout_gml.c.

1392 {
1393  uint32_t i;
1394  size_t size;
1395  size_t prefixlen = strlen(prefix);
1396  LWGEOM *subgeom;
1397 
1398  /* the longest possible multi version */
1399  size = sizeof("<MultiLineString></MultiLineString>") + prefixlen*2;
1400 
1401  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1402  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1403 
1404  for (i=0; i<col->ngeoms; i++)
1405  {
1406  subgeom = col->geoms[i];
1407  if (subgeom->type == POINTTYPE)
1408  {
1409  size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
1410  size += asgml3_point_size((LWPOINT*)subgeom, 0, precision, opts, prefix, id);
1411  }
1412  else if (subgeom->type == LINETYPE)
1413  {
1414  size += ( sizeof("<curveMember>/") + prefixlen ) * 2;
1415  size += asgml3_line_size((LWLINE*)subgeom, 0, precision, opts, prefix, id);
1416  }
1417  else if (subgeom->type == POLYGONTYPE)
1418  {
1419  size += ( sizeof("<surfaceMember>/") + prefixlen ) * 2;
1420  size += asgml3_poly_size((LWPOLY*)subgeom, 0, precision, opts, prefix, id);
1421  }
1422  }
1423 
1424  return size;
1425 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LINETYPE
Definition: liblwgeom.h:86
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:87
static size_t asgml3_poly_size(const LWPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:995
static size_t asgml3_point_size(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:775
static size_t asgml3_line_size(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:828
opts
Definition: ovdump.py:44
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t type
Definition: liblwgeom.h:399
unsigned int uint32_t
Definition: uthash.h:78

References asgml3_line_size(), asgml3_point_size(), asgml3_poly_size(), LWCOLLECTION::geoms, LINETYPE, LWCOLLECTION::ngeoms, ovdump::opts, POINTTYPE, POLYGONTYPE, precision, and LWGEOM::type.

Referenced by asgml3_collection_size(), and asgml3_multi().

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