PostGIS  2.1.10dev-r@@SVN_REVISION@@
static LWGEOM* parse_gml_surface ( xmlNodePtr  xnode,
bool *  hasz,
int *  root_srid 
)
static

Parse GML Surface (3.1.1)

Definition at line 1379 of file lwgeom_in_gml.c.

References get_xlink_node(), gml_lwerror(), is_gml_namespace(), is_xlink(), and parse_gml_patch().

Referenced by parse_gml().

1380 {
1381  xmlNodePtr xa;
1382  int patch;
1383  LWGEOM *geom=NULL;
1384  bool found=false;
1385 
1386  if (is_xlink(xnode)) xnode = get_xlink_node(xnode);
1387 
1388  /* Looking for gml:patches */
1389  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
1390  {
1391  if (xa->type != XML_ELEMENT_NODE) continue;
1392  if (!is_gml_namespace(xa, false)) continue;
1393  if (!strcmp((char *) xa->name, "patches"))
1394  {
1395  found = true;
1396  break;
1397  }
1398  }
1399  if (!found) gml_lwerror("invalid GML representation", 51);
1400 
1401  /* Processing gml:PolygonPatch */
1402  for (patch=0, xa = xa->children ; xa != NULL ; xa = xa->next)
1403  {
1404  if (xa->type != XML_ELEMENT_NODE) continue;
1405  if (!is_gml_namespace(xa, false)) continue;
1406  if (strcmp((char *) xa->name, "PolygonPatch")) continue;
1407  patch++;
1408 
1409  /* SQL/MM define ST_CurvePolygon as a single patch only,
1410  cf ISO 13249-3:2009 -> 4.2.9 (p27) */
1411  if (patch > 1) gml_lwerror("invalid GML representation", 52);
1412 
1413  geom = parse_gml_patch(xa, hasz, root_srid);
1414  }
1415 
1416  if (!patch) gml_lwerror("invalid GML representation", 53);
1417 
1418  return geom;
1419 }
static LWGEOM * parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML PolygonPatch (3.1.1)
static xmlNodePtr get_xlink_node(xmlNodePtr xnode)
Return a xmlNodePtr on a node referenced by a XLink or NULL otherwise.
LWGEOM * geom
static bool is_xlink(xmlNodePtr node)
Return true if current node contains a simple XLink Return false otherwise.
static bool is_gml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a GML one Return true otherwise. ...
static void gml_lwerror(char *msg, int error_code)
Definition: lwgeom_in_gml.c:68

Here is the call graph for this function:

Here is the caller graph for this function: