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

1762 {
1763  size_t prefixlen = strlen(prefix);
1764  size_t size = sizeof( "<MultiCurve></MultiCurve>" ) + 2 * prefixlen;
1765  if (srs) size += strlen(srs) + sizeof(" srsName=..");
1766  if (id) size += strlen(id) + strlen(prefix) + sizeof(" id=..");
1767  LWGEOM* subgeom;
1768  int i;
1769 
1770  for( i = 0; i < cur->ngeoms; ++i )
1771  {
1772  size += sizeof( "<curveMember></curveMember>" ) + 2 * prefixlen;
1773  subgeom = cur->geoms[i];
1774  if ( subgeom->type == LINETYPE )
1775  {
1776  size += asgml3_line_size( (LWLINE*)subgeom, srs, precision, opts, prefix, id );
1777  }
1778  else if( subgeom->type == CIRCSTRINGTYPE )
1779  {
1780  size += asgml3_circstring_size( (LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id );
1781  }
1782  else if( subgeom->type == COMPOUNDTYPE )
1783  {
1784  size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id );
1785  }
1786  }
1787  return size;
1788 }
int ngeoms
Definition: liblwgeom.h:546
#define LINETYPE
Definition: liblwgeom.h:86
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
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:1096
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:847
uint8_t precision
Definition: cu_in_twkb.c:25
LWGEOM ** geoms
Definition: liblwgeom.h:548
uint8_t type
Definition: liblwgeom.h:396
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:949
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: