PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ parse_kml()

static LWGEOM * parse_kml ( xmlNodePtr  xnode,
bool *  hasz 
)
static

Parse KML.

Definition at line 504 of file lwgeom_in_kml.c.

References is_kml_namespace(), parse_kml_line(), parse_kml_multi(), parse_kml_point(), and parse_kml_polygon().

Referenced by geom_from_kml(), and parse_kml_multi().

505 {
506  xmlNodePtr xa = xnode;
507 
508  while (xa != NULL && (xa->type != XML_ELEMENT_NODE
509  || !is_kml_namespace(xa, false))) xa = xa->next;
510 
511  if (xa == NULL) lwpgerror("invalid KML representation");
512 
513  if (!strcmp((char *) xa->name, "Point"))
514  return parse_kml_point(xa, hasz);
515 
516  if (!strcmp((char *) xa->name, "LineString"))
517  return parse_kml_line(xa, hasz);
518 
519  if (!strcmp((char *) xa->name, "Polygon"))
520  return parse_kml_polygon(xa, hasz);
521 
522  if (!strcmp((char *) xa->name, "MultiGeometry"))
523  return parse_kml_multi(xa, hasz);
524 
525  lwpgerror("invalid KML representation");
526  return NULL; /* Never reach */
527 }
static bool is_kml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a KML one Return true otherwise. ...
static LWGEOM * parse_kml_multi(xmlNodePtr xnode, bool *hasz)
Parse KML MultiGeometry.
static LWGEOM * parse_kml_polygon(xmlNodePtr xnode, bool *hasz)
Parse KML Polygon.
static LWGEOM * parse_kml_point(xmlNodePtr xnode, bool *hasz)
Parse KML point.
static LWGEOM * parse_kml_line(xmlNodePtr xnode, bool *hasz)
Parse KML lineString.
Here is the call graph for this function:
Here is the caller graph for this function: