PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t asgml2_poly_size ( const LWPOLY poly,
const char *  srs,
int  precision,
const char *  prefix 
)
static

Definition at line 340 of file lwout_gml.c.

References lwpoly_is_empty(), LWPOLY::nrings, pointArray_GMLsize(), and LWPOLY::rings.

Referenced by asgml2_collection_size(), asgml2_multi_size(), and asgml2_poly().

341 {
342  size_t size;
343  int i;
344  size_t prefixlen = strlen(prefix);
345 
346  size = sizeof("<polygon></polygon>") + prefixlen*2;
347  if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
348  if ( lwpoly_is_empty(poly) )
349  return size;
350  size += ( sizeof("<outerboundaryis><linearring><coordinates>/") + ( prefixlen*3) ) * 2;
351  size += ( sizeof("<innerboundaryis><linearring><coordinates>/") + ( prefixlen*2) ) * 2 * poly->nrings;
352 
353  for (i=0; i<poly->nrings; i++)
354  size += pointArray_GMLsize(poly->rings[i], precision);
355 
356  return size;
357 }
POINTARRAY ** rings
Definition: liblwgeom.h:413
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:327
int nrings
Definition: liblwgeom.h:411
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1471

Here is the call graph for this function:

Here is the caller graph for this function: