PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ parse_kml()

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

Parse KML.

Definition at line 534 of file lwgeom_in_kml.c.

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