PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ asgml3_multisurface_size()

static size_t asgml3_multisurface_size ( const LWMSURFACE sur,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1819 of file lwout_gml.c.

References asgml3_curvepoly_size(), asgml3_poly_size(), CURVEPOLYTYPE, LWMSURFACE::geoms, LWMSURFACE::ngeoms, POLYGONTYPE, and LWGEOM::type.

Referenced by asgml3_multisurface().

1820 {
1821  size_t prefixlen = strlen(prefix);
1822  size_t size = sizeof( "<MultiSurface></MultiSurface>" ) + 2 * prefixlen;
1823  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1824  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1825  LWGEOM* subgeom;
1826  uint32_t i;
1827 
1828  for( i = 0; i < sur->ngeoms; ++i )
1829  {
1830  subgeom = sur->geoms[i];
1831  if( subgeom->type == POLYGONTYPE )
1832  {
1833  size += asgml3_poly_size( (LWPOLY*)sur->geoms[i], srs, precision, opts, prefix, id );
1834  }
1835  else if( subgeom->type == CURVEPOLYTYPE )
1836  {
1837  size += asgml3_curvepoly_size( (LWCURVEPOLY*)sur->geoms[i], srs, precision, opts, prefix, id );
1838  }
1839  }
1840  return size;
1841 }
uint32_t ngeoms
Definition: liblwgeom.h:562
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
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:995
static size_t asgml3_curvepoly_size(const LWCURVEPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1192
unsigned int uint32_t
Definition: uthash.h:78
uint8_t precision
Definition: cu_in_twkb.c:25
LWGEOM ** geoms
Definition: liblwgeom.h:564
uint8_t type
Definition: liblwgeom.h:399
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: