PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ parse_kml_multi()

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

Parse KML MultiGeometry.

Definition at line 508 of file lwgeom_in_kml.c.

509 {
510  LWGEOM *geom;
511  xmlNodePtr xa;
512 
513  geom = (LWGEOM *)lwcollection_construct_empty(COLLECTIONTYPE, 4326, 1, 0);
514 
515  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
516  {
517 
518  if (xa->type != XML_ELEMENT_NODE) continue;
519  if (!is_kml_namespace(xa, false)) continue;
520 
521  if ( is_kml_element(xa, "Point")
522  || is_kml_element(xa, "LineString")
523  || is_kml_element(xa, "Polygon")
524  || is_kml_element(xa, "MultiGeometry"))
525  {
526 
527  if (xa->children == NULL) break;
528  geom = (LWGEOM*)lwcollection_add_lwgeom((LWCOLLECTION*)geom, parse_kml(xa, hasz));
529  }
530  }
531 
532  return geom;
533 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:122
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
Definition: lwcollection.c:92
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:188
static LWGEOM * parse_kml(xmlNodePtr xnode, bool *hasz)
Parse KML.
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 COLLECTIONTYPE, is_kml_element(), is_kml_namespace(), lwcollection_add_lwgeom(), lwcollection_construct_empty(), and parse_kml().

Referenced by parse_kml().

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