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

Parse GML.

Definition at line 1833 of file lwgeom_in_gml.c.

References gml_lwpgerror(), is_gml_namespace(), parse_gml_coll(), parse_gml_curve(), parse_gml_line(), parse_gml_linearring(), parse_gml_mcurve(), parse_gml_mline(), parse_gml_mpoint(), parse_gml_mpoly(), parse_gml_msurface(), parse_gml_point(), parse_gml_polygon(), parse_gml_psurface(), parse_gml_srs(), parse_gml_surface(), parse_gml_tin(), parse_gml_triangle(), struct_gmlSrs::srid, and SRID_UNKNOWN.

Referenced by lwgeom_from_gml(), parse_gml_coll(), parse_gml_mcurve(), parse_gml_mline(), parse_gml_mpoint(), parse_gml_mpoly(), and parse_gml_msurface().

1834 {
1835  xmlNodePtr xa = xnode;
1836  gmlSrs srs;
1837 
1838  while (xa != NULL && (xa->type != XML_ELEMENT_NODE
1839  || !is_gml_namespace(xa, false))) xa = xa->next;
1840 
1841  if (xa == NULL) gml_lwpgerror("invalid GML representation", 55);
1842 
1843  parse_gml_srs(xa, &srs);
1844  if (*root_srid == SRID_UNKNOWN && srs.srid != SRID_UNKNOWN)
1845  {
1846  *root_srid = srs.srid;
1847  }
1848 
1849  if (!strcmp((char *) xa->name, "Point"))
1850  return parse_gml_point(xa, hasz, root_srid);
1851 
1852  if (!strcmp((char *) xa->name, "LineString"))
1853  return parse_gml_line(xa, hasz, root_srid);
1854 
1855  if (!strcmp((char *) xa->name, "Curve"))
1856  return parse_gml_curve(xa, hasz, root_srid);
1857 
1858  if (!strcmp((char *) xa->name, "LinearRing"))
1859  return parse_gml_linearring(xa, hasz, root_srid);
1860 
1861  if (!strcmp((char *) xa->name, "Polygon"))
1862  return parse_gml_polygon(xa, hasz, root_srid);
1863 
1864  if (!strcmp((char *) xa->name, "Triangle"))
1865  return parse_gml_triangle(xa, hasz, root_srid);
1866 
1867  if (!strcmp((char *) xa->name, "Surface"))
1868  return parse_gml_surface(xa, hasz, root_srid);
1869 
1870  if (!strcmp((char *) xa->name, "MultiPoint"))
1871  return parse_gml_mpoint(xa, hasz, root_srid);
1872 
1873  if (!strcmp((char *) xa->name, "MultiLineString"))
1874  return parse_gml_mline(xa, hasz, root_srid);
1875 
1876  if (!strcmp((char *) xa->name, "MultiCurve"))
1877  return parse_gml_mcurve(xa, hasz, root_srid);
1878 
1879  if (!strcmp((char *) xa->name, "MultiPolygon"))
1880  return parse_gml_mpoly(xa, hasz, root_srid);
1881 
1882  if (!strcmp((char *) xa->name, "MultiSurface"))
1883  return parse_gml_msurface(xa, hasz, root_srid);
1884 
1885  if (!strcmp((char *) xa->name, "PolyhedralSurface"))
1886  return parse_gml_psurface(xa, hasz, root_srid);
1887 
1888  if ((!strcmp((char *) xa->name, "Tin")) ||
1889  !strcmp((char *) xa->name, "TriangulatedSurface" ))
1890  return parse_gml_tin(xa, hasz, root_srid);
1891 
1892  if (!strcmp((char *) xa->name, "MultiGeometry"))
1893  return parse_gml_coll(xa, hasz, root_srid);
1894 
1895  gml_lwpgerror("invalid GML representation", 56);
1896  return NULL; /* Never reach */
1897 }
static LWGEOM * parse_gml_triangle(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML Triangle (3.1.1)
static LWGEOM * parse_gml_mpoly(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML MultiPolygon (2.1.2, 3.1.1)
static LWGEOM * parse_gml_linearring(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML LinearRing (3.1.1)
static void gml_lwpgerror(char *msg, int error_code)
Definition: lwgeom_in_gml.c:67
static void parse_gml_srs(xmlNodePtr xnode, gmlSrs *srs)
Parse gml srsName attribute.
static LWGEOM * parse_gml_point(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML point (2.1.2, 3.1.1)
static LWGEOM * parse_gml_tin(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML Tin (and TriangulatedSurface) (3.1.1)
static LWGEOM * parse_gml_coll(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML MultiGeometry (2.1.2, 3.1.1)
static LWGEOM * parse_gml_mcurve(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML MultiCurve (3.1.1)
static LWGEOM * parse_gml_msurface(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML MultiSurface (3.1.1)
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:172
static LWGEOM * parse_gml_mpoint(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse gml:MultiPoint (2.1.2, 3.1.1)
static LWGEOM * parse_gml_curve(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML Curve (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 LWGEOM * parse_gml_surface(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML Surface (3.1.1)
static LWGEOM * parse_gml_psurface(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML PolyhedralSurface (3.1.1) Nota: It's not part of SF-2.
static LWGEOM * parse_gml_mline(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse gml:MultiLineString (2.1.2, 3.1.1)
static LWGEOM * parse_gml_polygon(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML Polygon (2.1.2, 3.1.1)
static LWGEOM * parse_gml_line(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse GML lineString (2.1.2, 3.1.1)

Here is the call graph for this function:

Here is the caller graph for this function: