PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ parse_kml_multi()

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

Parse KML MultiGeometry.

Definition at line 481 of file lwgeom_in_kml.c.

482 {
483  LWGEOM *geom;
484  xmlNodePtr xa;
485 
486  geom = (LWGEOM *)lwcollection_construct_empty(COLLECTIONTYPE, 4326, 1, 0);
487 
488  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
489  {
490 
491  if (xa->type != XML_ELEMENT_NODE) continue;
492  if (!is_kml_namespace(xa, false)) continue;
493 
494  if ( !strcmp((char *) xa->name, "Point")
495  || !strcmp((char *) xa->name, "LineString")
496  || !strcmp((char *) xa->name, "Polygon")
497  || !strcmp((char *) xa->name, "MultiGeometry"))
498  {
499 
500  if (xa->children == NULL) break;
501  geom = (LWGEOM*)lwcollection_add_lwgeom((LWCOLLECTION*)geom, parse_kml(xa, hasz));
502  }
503  }
504 
505  return geom;
506 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:108
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.

References COLLECTIONTYPE, 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: