PostGIS  2.1.10dev-r@@SVN_REVISION@@
static LWGEOM* parse_kml_multi ( xmlNodePtr  xnode,
bool *  hasz 
)
static

Parse KML MultiGeometry.

Definition at line 456 of file lwgeom_in_kml.c.

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

Referenced by parse_kml().

457 {
458  LWGEOM *geom;
459  xmlNodePtr xa;
460 
461  geom = (LWGEOM *)lwcollection_construct_empty(COLLECTIONTYPE, 4326, 1, 0);
462 
463  for (xa = xnode->children ; xa != NULL ; xa = xa->next)
464  {
465 
466  if (xa->type != XML_ELEMENT_NODE) continue;
467  if (!is_kml_namespace(xa, false)) continue;
468 
469  if ( !strcmp((char *) xa->name, "Point")
470  || !strcmp((char *) xa->name, "LineString")
471  || !strcmp((char *) xa->name, "Polygon")
472  || !strcmp((char *) xa->name, "MultiGeometry"))
473  {
474 
475  if (xa->children == NULL) break;
477  }
478  }
479 
480  return geom;
481 }
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.
LWGEOM * geom
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:174
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: