PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ parse_kml()

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

Parse KML.

Definition at line 539 of file lwgeom_in_kml.c.

540 {
541  xmlNodePtr xa = xnode;
542 
543  while (xa != NULL && (xa->type != XML_ELEMENT_NODE
544  || !is_kml_namespace(xa, false))) xa = xa->next;
545 
546  if (xa == NULL) lwpgerror("invalid KML representation");
547 
548  if (is_kml_element(xa, "Point"))
549  return parse_kml_point(xa, hasz);
550 
551  if (is_kml_element(xa, "LineString"))
552  return parse_kml_line(xa, hasz);
553 
554  if (is_kml_element(xa, "Polygon"))
555  return parse_kml_polygon(xa, hasz);
556 
557  if (is_kml_element(xa, "MultiGeometry"))
558  return parse_kml_multi(xa, hasz);
559 
560  lwpgerror("invalid KML representation");
561  return NULL; /* Never reach */
562 }
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:70

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: