PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ parse_kml()

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

Parse KML.

Definition at line 535 of file lwgeom_in_kml.c.

536 {
537  xmlNodePtr xa = xnode;
538 
539  while (xa != NULL && (xa->type != XML_ELEMENT_NODE
540  || !is_kml_namespace(xa, false))) xa = xa->next;
541 
542  if (xa == NULL) lwpgerror("invalid KML representation");
543 
544  if (is_kml_element(xa, "Point"))
545  return parse_kml_point(xa, hasz);
546 
547  if (is_kml_element(xa, "LineString"))
548  return parse_kml_line(xa, hasz);
549 
550  if (is_kml_element(xa, "Polygon"))
551  return parse_kml_polygon(xa, hasz);
552 
553  if (is_kml_element(xa, "MultiGeometry"))
554  return parse_kml_multi(xa, hasz);
555 
556  lwpgerror("invalid KML representation");
557  return NULL; /* Never reach */
558 }
static LWGEOM * parse_kml_line(xmlNodePtr xnode, bool *hasz)
Parse KML lineString.
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 bool is_kml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a KML one Return true otherwise.
static bool is_kml_element(xmlNodePtr xn, const char *kml_name)
Definition: lwgeom_in_kml.c:68

References is_kml_element(), 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().

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