PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgml2_multi_size ( const LWCOLLECTION col,
const char *  srs,
int  precision,
const char *  prefix 
)
static

Definition at line 406 of file lwout_gml.c.

References asgml2_line_size(), asgml2_point_size(), asgml2_poly_size(), LWCOLLECTION::geoms, LINETYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, and LWGEOM::type.

Referenced by asgml2_multi().

408 {
409  int i;
410  size_t size;
411  size_t prefixlen = strlen(prefix);
412  LWGEOM *subgeom;
413 
414  /* the longest possible multi version */
415  size = sizeof("<MultiLineString></MultiLineString>");
416  size += 2*prefixlen;
417 
418  if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
419 
420  for (i=0; i<col->ngeoms; i++)
421  {
422  subgeom = col->geoms[i];
423  if (subgeom->type == POINTTYPE)
424  {
425  size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
426  size += asgml2_point_size((LWPOINT*)subgeom, 0, precision, prefix);
427  }
428  else if (subgeom->type == LINETYPE)
429  {
430  size += ( sizeof("<lineStringMember>/") + prefixlen ) * 2;
431  size += asgml2_line_size((LWLINE*)subgeom, 0, precision, prefix);
432  }
433  else if (subgeom->type == POLYGONTYPE)
434  {
435  size += ( sizeof("<polygonMember>/") + prefixlen ) * 2;
436  size += asgml2_poly_size((LWPOLY*)subgeom, 0, precision, prefix);
437  }
438  }
439 
440  return size;
441 }
#define LINETYPE
Definition: liblwgeom.h:61
static size_t asgml2_point_size(const LWPOINT *point, const char *srs, int precision, const char *prefix)
Definition: lwout_gml.c:251
#define POLYGONTYPE
Definition: liblwgeom.h:62
static size_t asgml2_line_size(const LWLINE *line, const char *srs, int precision, const char *prefix)
Definition: lwout_gml.c:294
static size_t asgml2_poly_size(const LWPOLY *poly, const char *srs, int precision, const char *prefix)
Definition: lwout_gml.c:340
LWGEOM ** geoms
Definition: liblwgeom.h:465
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352

Here is the call graph for this function:

Here is the caller graph for this function: