PostGIS  3.3.9dev-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 1543 of file lwgeom_in_gml.c.

1544 {
1545  xmlNodePtr xa;
1546  int patch;
1547  LWGEOM *geom=NULL;
1548  bool found=false;
1549 
1550  if (is_xlink(xnode)) xnode = get_xlink_node(xnode);
1551  if (xnode == NULL)
1552  gml_lwpgerror("invalid GML representation", 30);
1553 
1554  /* Looking for gml:patches */
1555  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
1556  {
1557  if (xa->type != XML_ELEMENT_NODE) continue;
1558  if (!is_gml_namespace(xa, false)) continue;
1559  if (is_gml_element(xa, "patches"))
1560  {
1561  found = true;
1562  break;
1563  }
1564  }
1565  if (!found) gml_lwpgerror("invalid GML representation", 51);
1566 
1567  /* Processing gml:PolygonPatch */
1568  for (patch=0, xa = xa->children ; xa != NULL ; xa = xa->next)
1569  {
1570  if (xa->type != XML_ELEMENT_NODE) continue;
1571  if (!is_gml_namespace(xa, false)) continue;
1572  if (!is_gml_element(xa, "PolygonPatch")) continue;
1573  patch++;
1574 
1575  /* SQL/MM define ST_CurvePolygon as a single patch only,
1576  cf ISO 13249-3:2009 -> 4.2.9 (p27) */
1577  if (patch > 1) gml_lwpgerror("invalid GML representation", 52);
1578 
1579  geom = parse_gml_patch(xa, hasz, root_srid);
1580  }
1581 
1582  if (!patch) gml_lwpgerror("invalid GML representation", 53);
1583 
1584  return geom;
1585 }
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 LWGEOM * parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML PolygonPatch (3.1.1)
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_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
Definition: lwgeom_in_gml.c:81
static bool is_gml_element(xmlNodePtr xn, const char *gml_name)

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

Referenced by parse_gml().

Here is the call graph for this function:
Here is the caller graph for this function: