PostGIS  2.1.10dev-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 1079 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().

1080 {
1081  int type = col->type;
1082  char *ptr, *gmltype;
1083  int i;
1084  LWGEOM *subgeom;
1085 
1086  ptr = output;
1087  gmltype="";
1088 
1089  if (type == MULTIPOINTTYPE) gmltype = "MultiPoint";
1090  else if (type == MULTILINETYPE) gmltype = "MultiCurve";
1091  else if (type == MULTIPOLYGONTYPE) gmltype = "MultiSurface";
1092 
1093  /* Open outmost tag */
1094  ptr += sprintf(ptr, "<%s%s", prefix, gmltype);
1095  if (srs) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
1096  if (id) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
1097 
1098  if (!col->ngeoms) {
1099  ptr += sprintf(ptr, "/>");
1100  return (ptr-output);
1101  }
1102  ptr += sprintf(ptr, ">");
1103 
1104  for (i=0; i<col->ngeoms; i++)
1105  {
1106  subgeom = col->geoms[i];
1107  if (subgeom->type == POINTTYPE)
1108  {
1109  ptr += sprintf(ptr, "<%spointMember>", prefix);
1110  ptr += asgml3_point_buf((LWPOINT*)subgeom, 0, ptr, precision, opts, prefix, id);
1111  ptr += sprintf(ptr, "</%spointMember>", prefix);
1112  }
1113  else if (subgeom->type == LINETYPE)
1114  {
1115  ptr += sprintf(ptr, "<%scurveMember>", prefix);
1116  ptr += asgml3_line_buf((LWLINE*)subgeom, 0, ptr, precision, opts, prefix, id);
1117  ptr += sprintf(ptr, "</%scurveMember>", prefix);
1118  }
1119  else if (subgeom->type == POLYGONTYPE)
1120  {
1121  ptr += sprintf(ptr, "<%ssurfaceMember>", prefix);
1122  ptr += asgml3_poly_buf((LWPOLY*)subgeom, 0, ptr, precision, opts, 0, prefix, id);
1123  ptr += sprintf(ptr, "</%ssurfaceMember>", prefix);
1124  }
1125  }
1126 
1127  /* Close outmost tag */
1128  ptr += sprintf(ptr, "</%s%s>", prefix, gmltype);
1129 
1130  return (ptr-output);
1131 }
#define LINETYPE
Definition: liblwgeom.h:61
uint8_t type
Definition: liblwgeom.h:459
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
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:768
LWGEOM ** geoms
Definition: liblwgeom.h:465
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:917
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
#define MULTILINETYPE
Definition: liblwgeom.h:64
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:833

Here is the call graph for this function:

Here is the caller graph for this function: