PostGIS  3.1.6dev-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 1404 of file lwout_gml.c.

1405 {
1406  uint32_t i;
1407  size_t size;
1408  size_t prefixlen = strlen(prefix);
1409  LWGEOM *subgeom;
1410 
1411  /* the longest possible multi version */
1412  size = sizeof("<MultiLineString></MultiLineString>") + prefixlen*2;
1413 
1414  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1415  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1416 
1417  for (i=0; i<col->ngeoms; i++)
1418  {
1419  subgeom = col->geoms[i];
1420  if (subgeom->type == POINTTYPE)
1421  {
1422  size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
1423  size += asgml3_point_size((LWPOINT*)subgeom, 0, precision, opts, prefix, id);
1424  }
1425  else if (subgeom->type == LINETYPE)
1426  {
1427  size += ( sizeof("<curveMember>/") + prefixlen ) * 2;
1428  size += asgml3_line_size((LWLINE*)subgeom, 0, precision, opts, prefix, id);
1429  }
1430  else if (subgeom->type == POLYGONTYPE)
1431  {
1432  size += ( sizeof("<surfaceMember>/") + prefixlen ) * 2;
1433  size += asgml3_poly_size((LWPOLY*)subgeom, 0, precision, opts, prefix, id);
1434  }
1435  }
1436 
1437  return size;
1438 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LINETYPE
Definition: liblwgeom.h:117
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:116
#define POLYGONTYPE
Definition: liblwgeom.h:118
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:1004
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:785
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:836
opts
Definition: ovdump.py:45
uint32_t ngeoms
Definition: liblwgeom.h:594
LWGEOM ** geoms
Definition: liblwgeom.h:589
uint8_t type
Definition: liblwgeom.h:476

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: