PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ parse_kml_multi()

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

Parse KML MultiGeometry.

Definition at line 486 of file lwgeom_in_kml.c.

References COLLECTIONTYPE, is_kml_namespace(), lwcollection_add_lwgeom(), lwcollection_construct_empty(), and parse_kml().

Referenced by parse_kml().

487 {
488  LWGEOM *geom;
489  xmlNodePtr xa;
490 
491  geom = (LWGEOM *)lwcollection_construct_empty(COLLECTIONTYPE, 4326, 1, 0);
492 
493  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
494  {
495 
496  if (xa->type != XML_ELEMENT_NODE) continue;
497  if (!is_kml_namespace(xa, false)) continue;
498 
499  if ( !strcmp((char *) xa->name, "Point")
500  || !strcmp((char *) xa->name, "LineString")
501  || !strcmp((char *) xa->name, "Polygon")
502  || !strcmp((char *) xa->name, "MultiGeometry"))
503  {
504 
505  if (xa->children == NULL) break;
506  geom = (LWGEOM*)lwcollection_add_lwgeom((LWCOLLECTION*)geom, parse_kml(xa, hasz));
507  }
508  }
509 
510  return geom;
511 }
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 LWGEOM * parse_kml(xmlNodePtr xnode, bool *hasz)
Parse KML.
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: