PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ asgml3_multi_buf()

static size_t asgml3_multi_buf ( const LWCOLLECTION col,
const char *  srs,
char *  output,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 1430 of file lwout_gml.c.

1431 {
1432  int type = col->type;
1433  char *ptr, *gmltype;
1434  uint32_t i;
1435  LWGEOM *subgeom;
1436 
1437  ptr = output;
1438  gmltype="";
1439 
1440  if (type == MULTIPOINTTYPE) gmltype = "MultiPoint";
1441  else if (type == MULTILINETYPE) gmltype = "MultiCurve";
1442  else if (type == MULTIPOLYGONTYPE) gmltype = "MultiSurface";
1443 
1444  /* Open outmost tag */
1445  ptr += sprintf(ptr, "<%s%s", prefix, gmltype);
1446  if (srs) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1447  if (id) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
1448 
1449  if (!col->ngeoms)
1450  {
1451  ptr += sprintf(ptr, "/>");
1452  return (ptr-output);
1453  }
1454  ptr += sprintf(ptr, ">");
1455 
1456  for (i=0; i<col->ngeoms; i++)
1457  {
1458  subgeom = col->geoms[i];
1459  if (subgeom->type == POINTTYPE)
1460  {
1461  ptr += sprintf(ptr, "<%spointMember>", prefix);
1462  ptr += asgml3_point_buf((LWPOINT*)subgeom, 0, ptr, precision, opts, prefix, id);
1463  ptr += sprintf(ptr, "</%spointMember>", prefix);
1464  }
1465  else if (subgeom->type == LINETYPE)
1466  {
1467  ptr += sprintf(ptr, "<%scurveMember>", prefix);
1468  ptr += asgml3_line_buf((LWLINE*)subgeom, 0, ptr, precision, opts, prefix, id);
1469  ptr += sprintf(ptr, "</%scurveMember>", prefix);
1470  }
1471  else if (subgeom->type == POLYGONTYPE)
1472  {
1473  ptr += sprintf(ptr, "<%ssurfaceMember>", prefix);
1474  ptr += asgml3_poly_buf((LWPOLY*)subgeom, 0, ptr, precision, opts, 0, prefix, id);
1475  ptr += sprintf(ptr, "</%ssurfaceMember>", prefix);
1476  }
1477  }
1478 
1479  /* Close outmost tag */
1480  ptr += sprintf(ptr, "</%s%s>", prefix, gmltype);
1481 
1482  return (ptr-output);
1483 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define MULTILINETYPE
Definition: liblwgeom.h:120
#define LINETYPE
Definition: liblwgeom.h:117
#define MULTIPOINTTYPE
Definition: liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:121
#define POLYGONTYPE
Definition: liblwgeom.h:118
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:854
static size_t asgml3_point_buf(const LWPOINT *point, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
Definition: lwout_gml.c:788
static size_t asgml3_poly_buf(const LWPOLY *poly, const char *srs, char *output, int precision, int opts, int is_patch, const char *prefix, const char *id)
Definition: lwout_gml.c:1014
opts
Definition: ovdump.py:45
type
Definition: ovdump.py:42
uint32_t ngeoms
Definition: liblwgeom.h:566
uint8_t type
Definition: liblwgeom.h:564
LWGEOM ** geoms
Definition: liblwgeom.h:561
uint8_t type
Definition: liblwgeom.h:448

References asgml3_line_buf(), asgml3_point_buf(), asgml3_poly_buf(), LWCOLLECTION::geoms, LINETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, ovdump::opts, POINTTYPE, POLYGONTYPE, precision, LWGEOM::type, LWCOLLECTION::type, and ovdump::type.

Referenced by asgml3_collection_buf(), and asgml3_multi().

Here is the call graph for this function:
Here is the caller graph for this function: