PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ parse_gml_surface()

static LWGEOM* parse_gml_surface ( xmlNodePtr  xnode,
bool *  hasz,
int *  root_srid 
)
static

Parse GML Surface (3.1.1)

Definition at line 1374 of file lwgeom_in_gml.c.

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

Referenced by parse_gml().

1375 {
1376  xmlNodePtr xa;
1377  int patch;
1378  LWGEOM *geom=NULL;
1379  bool found=false;
1380 
1381  if (is_xlink(xnode)) xnode = get_xlink_node(xnode);
1382 
1383  /* Looking for gml:patches */
1384  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
1385  {
1386  if (xa->type != XML_ELEMENT_NODE) continue;
1387  if (!is_gml_namespace(xa, false)) continue;
1388  if (!strcmp((char *) xa->name, "patches"))
1389  {
1390  found = true;
1391  break;
1392  }
1393  }
1394  if (!found) gml_lwpgerror("invalid GML representation", 51);
1395 
1396  /* Processing gml:PolygonPatch */
1397  for (patch=0, xa = xa->children ; xa != NULL ; xa = xa->next)
1398  {
1399  if (xa->type != XML_ELEMENT_NODE) continue;
1400  if (!is_gml_namespace(xa, false)) continue;
1401  if (strcmp((char *) xa->name, "PolygonPatch")) continue;
1402  patch++;
1403 
1404  /* SQL/MM define ST_CurvePolygon as a single patch only,
1405  cf ISO 13249-3:2009 -> 4.2.9 (p27) */
1406  if (patch > 1) gml_lwpgerror("invalid GML representation", 52);
1407 
1408  geom = parse_gml_patch(xa, hasz, root_srid);
1409  }
1410 
1411  if (!patch) gml_lwpgerror("invalid GML representation", 53);
1412 
1413  return geom;
1414 }
static void gml_lwpgerror(char *msg, int error_code)
Definition: lwgeom_in_gml.c:67
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.
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. ...
Here is the call graph for this function:
Here is the caller graph for this function: