3

I've got a KMZ file which contains an API link for a map overlay, this is the link to that file. (The corresponding json file (link here), posted only gives me a link to a low resolution image and the bounds.)

I want to use this map in some python application, mainly using geopandas, which uses Fiona which does not support KMZ.

I've found some web applications that can convert KMZ files to geoJSON or geoTIFF, but not this KMZ file (or I get 1 pixel or something).

So I tried installing Google Earth Pro and loading the file into that, which works just fine, it seems Google Earth knows how to interface with this. However, when I then try to export the layer I end up with the exact same KMZ file I started with.

Is there anyone who can point me towards a program or script that can do this conversion for me?

2 Answers 2

2

This link works for me: http://programmingadvent.blogspot.cl/2013/06/kmzkml-file-parsing-with-python.html

It is slightly involved but it recognises a kmz as a zipped kml with a 'doc.kml' file inside it. Then, using xml, it parses the file to return the data.

0

This answer works for both KMZ and KML files, but uses ESRI ArcPy:

Converting .kmz to .shp in arcpy

This answer uses GeoPandas (free and open source), but I have had issues with this method if more than one type of feature class exists in the KMZ/KML file:

https://docs.astraea.earth/hc/en-us/articles/360043923831-Read-a-KML-File-into-a-GeoPandas-DataFrame

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.