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

Parse KML.

Definition at line 487 of file lwgeom_in_kml.c.

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

Referenced by geom_from_kml(), and parse_kml_multi().

488 {
489  xmlNodePtr xa = xnode;
490 
491  while (xa != NULL && (xa->type != XML_ELEMENT_NODE
492  || !is_kml_namespace(xa, false))) xa = xa->next;
493 
494  if (xa == NULL) lwerror("invalid KML representation");
495 
496  if (!strcmp((char *) xa->name, "Point"))
497  return parse_kml_point(xa, hasz);
498 
499  if (!strcmp((char *) xa->name, "LineString"))
500  return parse_kml_line(xa, hasz);
501 
502  if (!strcmp((char *) xa->name, "Polygon"))
503  return parse_kml_polygon(xa, hasz);
504 
505  if (!strcmp((char *) xa->name, "MultiGeometry"))
506  return parse_kml_multi(xa, hasz);
507 
508  lwerror("invalid KML representation");
509  return NULL; /* Never reach */
510 }
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.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
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: