PostGIS  2.3.8dev-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 1410 of file lwout_gml.c.

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

Referenced by asgml3_collection_size(), and asgml3_multi().

1411 {
1412  int i;
1413  size_t size;
1414  size_t prefixlen = strlen(prefix);
1415  LWGEOM *subgeom;
1416 
1417  /* the longest possible multi version */
1418  size = sizeof("<MultiLineString></MultiLineString>") + prefixlen*2;
1419 
1420  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1421  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1422 
1423  for (i=0; i<col->ngeoms; i++)
1424  {
1425  subgeom = col->geoms[i];
1426  if (subgeom->type == POINTTYPE)
1427  {
1428  size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
1429  size += asgml3_point_size((LWPOINT*)subgeom, 0, precision, opts, prefix, id);
1430  }
1431  else if (subgeom->type == LINETYPE)
1432  {
1433  size += ( sizeof("<curveMember>/") + prefixlen ) * 2;
1434  size += asgml3_line_size((LWLINE*)subgeom, 0, precision, opts, prefix, id);
1435  }
1436  else if (subgeom->type == POLYGONTYPE)
1437  {
1438  size += ( sizeof("<surfaceMember>/") + prefixlen ) * 2;
1439  size += asgml3_poly_size((LWPOLY*)subgeom, 0, precision, opts, prefix, id);
1440  }
1441  }
1442 
1443  return size;
1444 }
#define LINETYPE
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:86
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:1014
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:847
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:794
LWGEOM ** geoms
Definition: liblwgeom.h:508
uint8_t precision
Definition: cu_in_twkb.c:25
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: