[gdal-dev] Determine which KML file inside a KMZ a Layer comes from?

Simon Eves simon.eves at omnisci.com
Mon Apr 15 11:34:24 PDT 2019


I have a KMZ which contains five KML files (not including the top-level
doc.kml), most of which contains a single-digit number of layers, each with
a large number (hundreds to thousands) of features.

When I open the KMZ with openGDALDataset() and then use
OGRDataSource::GetLayers() (the new variant which returns a collection) I
get a merged list of all the layers from all the KMLs.

I am importing the data and grouping it by layer, with a single global
prefix provided by the user, but as some of the KMLs have layers which have
the same name as layers in another KML, the resulting merged set of layer
names may not all be unique.

Is there any way to determine which KML a particular layer came from, or to
get the list of KML files and then iterate the layers for each in turn?

Also, one of those five KMLs actually has 1720 layers, each of which only
contains one feature. As an aside, is this common?

Thanks in advance!

-- 
<http://www.omnisci.com/>
Simon Eves
Senior Graphics Engineer, Rendering Group
OmniSci, formerly named MapD


e: simon.eves at omnisci.com | c:  415.902.1996
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190415/3df468ac/attachment.html>


More information about the gdal-dev mailing list