PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asgml2_poly_size()

static size_t asgml2_poly_size ( const LWPOLY poly,
const char *  srs,
int  precision,
const char *  prefix 
)
static

Definition at line 349 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().

350 {
351  size_t size;
352  int i;
353  size_t prefixlen = strlen(prefix);
354 
355  size = sizeof("<polygon></polygon>") + prefixlen*2;
356  if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
357  if ( lwpoly_is_empty(poly) )
358  return size;
359  size += ( sizeof("<outerboundaryis><linearring><coordinates>/") + ( prefixlen*3) ) * 2;
360  size += ( sizeof("<innerboundaryis><linearring><coordinates>/") + ( prefixlen*2) ) * 2 * poly->nrings;
361 
362  for (i=0; i<poly->nrings; i++)
363  size += pointArray_GMLsize(poly->rings[i], precision);
364 
365  return size;
366 }
POINTARRAY ** rings
Definition: liblwgeom.h:441
uint8_t precision
Definition: cu_in_twkb.c:25
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:332
int nrings
Definition: liblwgeom.h:439
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1974
Here is the call graph for this function:
Here is the caller graph for this function: