PostGIS  2.4.9dev-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 362 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().

363 {
364  size_t size;
365  int i;
366  size_t prefixlen = strlen(prefix);
367 
368  size = sizeof("<polygon></polygon>") + prefixlen*2;
369  if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
370  if ( lwpoly_is_empty(poly) )
371  return size;
372  size += ( sizeof("<outerboundaryis><linearring><coordinates>/") + ( prefixlen*3) ) * 2;
373  size += ( sizeof("<innerboundaryis><linearring><coordinates>/") + ( prefixlen*2) ) * 2 * poly->nrings;
374 
375  for (i=0; i<poly->nrings; i++)
376  size += pointArray_GMLsize(poly->rings[i], precision);
377 
378  return size;
379 }
POINTARRAY ** rings
Definition: liblwgeom.h:457
uint8_t precision
Definition: cu_in_twkb.c:25
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:445
int nrings
Definition: liblwgeom.h:455
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
Definition: lwout_gml.c:1987
Here is the call graph for this function:
Here is the caller graph for this function: