PostGIS  3.3.9dev-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 1444 of file lwout_gml.c.

1445 {
1446  int type = col->type;
1447  char *ptr, *gmltype;
1448  uint32_t i;
1449  LWGEOM *subgeom;
1450 
1451  ptr = output;
1452  gmltype="";
1453 
1454  if (type == MULTIPOINTTYPE) gmltype = "MultiPoint";
1455  else if (type == MULTILINETYPE) gmltype = "MultiCurve";
1456  else if (type == MULTIPOLYGONTYPE) gmltype = "MultiSurface";
1457 
1458  /* Open outmost tag */
1459  ptr += sprintf(ptr, "<%s%s", prefix, gmltype);
1460  if (srs) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1461  if (id) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
1462 
1463  if (!col->ngeoms)
1464  {
1465  ptr += sprintf(ptr, "/>");
1466  return (ptr-output);
1467  }
1468  ptr += sprintf(ptr, ">");
1469 
1470  for (i=0; i<col->ngeoms; i++)
1471  {
1472  subgeom = col->geoms[i];
1473  if (subgeom->type == POINTTYPE)
1474  {
1475  ptr += sprintf(ptr, "<%spointMember>", prefix);
1476  ptr += asgml3_point_buf((LWPOINT*)subgeom, 0, ptr, precision, opts, prefix, id);
1477  ptr += sprintf(ptr, "</%spointMember>", prefix);
1478  }
1479  else if (subgeom->type == LINETYPE)
1480  {
1481  ptr += sprintf(ptr, "<%scurveMember>", prefix);
1482  ptr += asgml3_line_buf((LWLINE*)subgeom, 0, ptr, precision, opts, prefix, id);
1483  ptr += sprintf(ptr, "</%scurveMember>", prefix);
1484  }
1485  else if (subgeom->type == POLYGONTYPE)
1486  {
1487  ptr += sprintf(ptr, "<%ssurfaceMember>", prefix);
1488  ptr += asgml3_poly_buf((LWPOLY*)subgeom, 0, ptr, precision, opts, 0, prefix, id);
1489  ptr += sprintf(ptr, "</%ssurfaceMember>", prefix);
1490  }
1491  }
1492 
1493  /* Close outmost tag */
1494  ptr += sprintf(ptr, "</%s%s>", prefix, gmltype);
1495 
1496  return (ptr-output);
1497 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define MULTILINETYPE
Definition: liblwgeom.h:121
#define LINETYPE
Definition: liblwgeom.h:118
#define MULTIPOINTTYPE
Definition: liblwgeom.h:120
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:117
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:122
#define POLYGONTYPE
Definition: liblwgeom.h:119
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:863
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:799
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:1024
opts
Definition: ovdump.py:45
type
Definition: ovdump.py:42
uint32_t ngeoms
Definition: liblwgeom.h:595
uint8_t type
Definition: liblwgeom.h:593
LWGEOM ** geoms
Definition: liblwgeom.h:590
uint8_t type
Definition: liblwgeom.h:477

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: