kmlattrs.py: a script making KML attributes accessible to Openlayers
This is a Python script which opens a KML file and rewrites each item found in the <extendeddata> section to plain attributes in the form <attributename> value </attributename>.
This makes possible to parse KML attributes with the OpenLayers.Format.KML class, which is not capable of parsing the "extendedData" section.
It is just a workaround, but it worked in my case. I hope that soon OpenLayers will extend its support for KML attributes.
Here is the download link for the script (zip file).
The script requires Python and the lxml library installed. Syntax is the following:
python kmlattrs.py -i filein.kml -o fileout.kml [-r]
where:
-i
KML input file
-o
KML output file
-r
removes the <ExtendedData> section from the output KML file
- Login to post comments
