PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ asgml3_multicurve_size()

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 1742 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().

1743 {
1744  size_t prefixlen = strlen(prefix);
1745  size_t size = sizeof( "<MultiCurve></MultiCurve>" ) + 2 * prefixlen;
1746  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1747  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1748  LWGEOM* subgeom;
1749  uint32_t i;
1750 
1751  for( i = 0; i < cur->ngeoms; ++i )
1752  {
1753  size += sizeof( "<curveMember></curveMember>" ) + 2 * prefixlen;
1754  subgeom = cur->geoms[i];
1755  if ( subgeom->type == LINETYPE )
1756  {
1757  size += asgml3_line_size( (LWLINE*)subgeom, srs, precision, opts, prefix, id );
1758  }
1759  else if( subgeom->type == CIRCSTRINGTYPE )
1760  {
1761  size += asgml3_circstring_size( (LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id );
1762  }
1763  else if( subgeom->type == COMPOUNDTYPE )
1764  {
1765  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1766  }
1767  }
1768  return size;
1769 }
#define LINETYPE
Definition: liblwgeom.h:85
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
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:1077
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:828
unsigned int uint32_t
Definition: uthash.h:78
uint8_t precision
Definition: cu_in_twkb.c:25
LWGEOM ** geoms
Definition: liblwgeom.h:550
uint8_t type
Definition: liblwgeom.h:398
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:930
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
uint32_t ngeoms
Definition: liblwgeom.h:548
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: