PostGIS  2.2.7dev-r@@SVN_REVISION@@
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 1437 of file lwout_gml.c.

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

Referenced by asgml3_collection_buf(), and asgml3_multi().

1438 {
1439  int type = col->type;
1440  char *ptr, *gmltype;
1441  int i;
1442  LWGEOM *subgeom;
1443 
1444  ptr = output;
1445  gmltype="";
1446 
1447  if (type == MULTIPOINTTYPE) gmltype = "MultiPoint";
1448  else if (type == MULTILINETYPE) gmltype = "MultiCurve";
1449  else if (type == MULTIPOLYGONTYPE) gmltype = "MultiSurface";
1450 
1451  /* Open outmost tag */
1452  ptr += sprintf(ptr, "<%s%s", prefix, gmltype);
1453  if (srs) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1454  if (id) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
1455 
1456  if (!col->ngeoms)
1457  {
1458  ptr += sprintf(ptr, "/>");
1459  return (ptr-output);
1460  }
1461  ptr += sprintf(ptr, ">");
1462 
1463  for (i=0; i<col->ngeoms; i++)
1464  {
1465  subgeom = col->geoms[i];
1466  if (subgeom->type == POINTTYPE)
1467  {
1468  ptr += sprintf(ptr, "<%spointMember>", prefix);
1469  ptr += asgml3_point_buf((LWPOINT*)subgeom, 0, ptr, precision, opts, prefix, id);
1470  ptr += sprintf(ptr, "</%spointMember>", prefix);
1471  }
1472  else if (subgeom->type == LINETYPE)
1473  {
1474  ptr += sprintf(ptr, "<%scurveMember>", prefix);
1475  ptr += asgml3_line_buf((LWLINE*)subgeom, 0, ptr, precision, opts, prefix, id);
1476  ptr += sprintf(ptr, "</%scurveMember>", prefix);
1477  }
1478  else if (subgeom->type == POLYGONTYPE)
1479  {
1480  ptr += sprintf(ptr, "<%ssurfaceMember>", prefix);
1481  ptr += asgml3_poly_buf((LWPOLY*)subgeom, 0, ptr, precision, opts, 0, prefix, id);
1482  ptr += sprintf(ptr, "</%ssurfaceMember>", prefix);
1483  }
1484  }
1485 
1486  /* Close outmost tag */
1487  ptr += sprintf(ptr, "</%s%s>", prefix, gmltype);
1488 
1489  return (ptr-output);
1490 }
#define LINETYPE
Definition: liblwgeom.h:71
uint8_t type
Definition: liblwgeom.h:487
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
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:795
LWGEOM ** geoms
Definition: liblwgeom.h:493
uint8_t precision
Definition: cu_in_twkb.c:25
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:1021
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
#define MULTILINETYPE
Definition: liblwgeom.h:74
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:861

Here is the call graph for this function:

Here is the caller graph for this function: