PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ asgml3_multicurve_buf()

static size_t asgml3_multicurve_buf ( const LWMCURVE cur,
const char *  srs,
char *  output,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1790 of file lwout_gml.c.

References asgml3_circstring_buf(), asgml3_compound_buf(), asgml3_line_buf(), CIRCSTRINGTYPE, COMPOUNDTYPE, LWMCURVE::geoms, LINETYPE, LWMCURVE::ngeoms, and LWGEOM::type.

Referenced by asgml3_multicurve().

1791 {
1792  char* ptr = output;
1793  LWGEOM* subgeom;
1794  int i;
1795 
1796  ptr += sprintf(ptr, "<%sMultiCurve", prefix );
1797  if (srs)
1798  {
1799  ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1800  }
1801  if (id)
1802  {
1803  ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id );
1804  }
1805  ptr += sprintf( ptr, ">");
1806 
1807  for( i = 0; i < cur->ngeoms; ++i )
1808  {
1809  ptr += sprintf(ptr, "<%scurveMember>", prefix );
1810  subgeom = cur->geoms[i];
1811  if ( subgeom->type == LINETYPE )
1812  {
1813  ptr += asgml3_line_buf( (LWLINE*)subgeom, srs, ptr, precision, opts, prefix, id );
1814  }
1815  else if( subgeom->type == CIRCSTRINGTYPE )
1816  {
1817  ptr += asgml3_circstring_buf( (LWCIRCSTRING*)subgeom, srs, ptr, precision, opts, prefix, id );
1818  }
1819  else if( subgeom->type == COMPOUNDTYPE )
1820  {
1821  ptr += asgml3_compound_buf( (LWCOMPOUND*)subgeom, srs, ptr, precision, opts, prefix, id );
1822  }
1823  ptr += sprintf(ptr, "</%scurveMember>", prefix );
1824  }
1825  ptr += sprintf(ptr, "</%sMultiCurve>", prefix );
1826  return (ptr - output);
1827 }
int ngeoms
Definition: liblwgeom.h:546
#define LINETYPE
Definition: liblwgeom.h:86
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
static size_t asgml3_compound_buf(const LWCOMPOUND *col, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:1138
static size_t asgml3_circstring_buf(const LWCIRCSTRING *circ, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:962
uint8_t precision
Definition: cu_in_twkb.c:25
LWGEOM ** geoms
Definition: liblwgeom.h:548
uint8_t type
Definition: liblwgeom.h:396
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
opts
Definition: ovdump.py:44
static size_t asgml3_line_buf(const LWLINE *line, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:874
Here is the call graph for this function:
Here is the caller graph for this function: