PostGIS  2.1.10dev-r@@SVN_REVISION@@
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 1039 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().

1040 {
1041  int i;
1042  size_t size;
1043  size_t prefixlen = strlen(prefix);
1044  LWGEOM *subgeom;
1045 
1046  /* the longest possible multi version */
1047  size = sizeof("<MultiLineString></MultiLineString>") + prefixlen*2;
1048 
1049  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1050  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1051 
1052  for (i=0; i<col->ngeoms; i++)
1053  {
1054  subgeom = col->geoms[i];
1055  if (subgeom->type == POINTTYPE)
1056  {
1057  size += ( sizeof("<pointMember>/") + prefixlen ) * 2;
1058  size += asgml3_point_size((LWPOINT*)subgeom, 0, precision, opts, prefix, id);
1059  }
1060  else if (subgeom->type == LINETYPE)
1061  {
1062  size += ( sizeof("<curveMember>/") + prefixlen ) * 2;
1063  size += asgml3_line_size((LWLINE*)subgeom, 0, precision, opts, prefix, id);
1064  }
1065  else if (subgeom->type == POLYGONTYPE)
1066  {
1067  size += ( sizeof("<surfaceMember>/") + prefixlen ) * 2;
1068  size += asgml3_poly_size((LWPOLY*)subgeom, 0, precision, opts, prefix, id);
1069  }
1070  }
1071 
1072  return size;
1073 }
#define LINETYPE
Definition: liblwgeom.h:61
#define POLYGONTYPE
Definition: liblwgeom.h:62
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:897
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:806
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:754
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: