PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t asgml3_multicurve_size ( const LWMCURVE cur,
const char *  srs,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1748 of file lwout_gml.c.

References asgml3_circstring_size(), asgml3_compound_size(), asgml3_line_size(), CIRCSTRINGTYPE, COMPOUNDTYPE, LWMCURVE::geoms, LINETYPE, LWMCURVE::ngeoms, and LWGEOM::type.

Referenced by asgml3_multicurve().

1749 {
1750  size_t prefixlen = strlen(prefix);
1751  size_t size = sizeof( "<MultiCurve></MultiCurve>" ) + 2 * prefixlen;
1752  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1753  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1754  LWGEOM* subgeom;
1755  int i;
1756 
1757  for( i = 0; i < cur->ngeoms; ++i )
1758  {
1759  size += sizeof( "<curveMember></curveMember>" ) + 2 * prefixlen;
1760  subgeom = cur->geoms[i];
1761  if ( subgeom->type == LINETYPE )
1762  {
1763  size += asgml3_line_size( (LWLINE*)subgeom, srs, precision, opts, prefix, id );
1764  }
1765  else if( subgeom->type == CIRCSTRINGTYPE )
1766  {
1767  size += asgml3_circstring_size( (LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id );
1768  }
1769  else if( subgeom->type == COMPOUNDTYPE )
1770  {
1771  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1772  }
1773  }
1774  return size;
1775 }
int ngeoms
Definition: liblwgeom.h:530
#define LINETYPE
Definition: liblwgeom.h:71
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
static size_t asgml3_compound_size(const LWCOMPOUND *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1083
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:834
uint8_t precision
Definition: cu_in_twkb.c:25
LWGEOM ** geoms
Definition: liblwgeom.h:532
uint8_t type
Definition: liblwgeom.h:380
static size_t asgml3_circstring_size(const LWCIRCSTRING *circ, const char *srs, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:936
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77

Here is the call graph for this function:

Here is the caller graph for this function: