Feature request #5242
Open KMZ without needing to unzip
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||14977|
It would be awfully nice if we could import KMZ files directly, without needing to unzip and import the KML files.
#2 Updated by Alister Hood about 9 years ago
FWIW, gdal/QGIS can already open a KMZ file, using the vsizip driver:
H:\\>ogrinfo /vsizip/C:\\ZZ\\test2.kmz Had to open data source read-only. INFO: Open of `/vsizip/C:\\ZZ\\test2.kmz' using driver `KML' successful. 1: test2 (Point)
And if I manually edit a .qgs file to add the kmz layer like this, then QGIS can open it:
So I think all that is needed is to get QGIS and/or GDAL to automatically recognise the kmz layer. I guess it would be better to do this in GDAL than in QGIS...
#5 Updated by Larry Shaffer about 9 years ago
- Status changed from Open to Feedback
- Category changed from Vectors to Data Provider
Summary: On a Mac, where QGIS uses the Kyngchaos.com GDAL 1.9 Complete framework, or on any platform where QGIS has been compiled against a GDAL build with support for the Google LIBKML driver, you can open .kmz files directly using the open dialog and selecting the All Files (*) option, or simply drag/drop onto QGIS.
Not sure if the file structure of a ZIP archive is identical to that of a KMZ archive. Using Google's LIBKML driver might handle any issues. Currently GDAL in the Windows installers and Linux packages does not provide the LIBKML driver.
I tried Alister's workaround (change .kmz to .zip) and, on drag/drop, was presented with the Open ZIP Layer dialog, which led to the Open KML dialog, when a .kml file was chosen. Resulting in:
When br_sv.zip was changed back to br_sv.kmz (in project file) and the project reloaded, the given data source was treated the same as a ZIP, confirming Alister's findings on Mac, as well.
In lieu of waiting for different platforms to provide LIBKML driver support, Alister's suggestion to have .kmz treated as .zip sounds good, since users are already accessing the archived data in the same manner, just manually.
One issue I found: when drag/drop of .zip file, there was a cyclical reopening of the ZIP layers dialog, after importing KML layers. A simple Cancel dismissed the dialog. If not cancelled the second time around ends with "/Downloads/br_sv.zip is not a valid or recognized data source". May be a bug in QGIS ZIP support.
Multi-layered kml embedded in .kmz file for testing: http://coastal.er.usgs.gov/flash/google_earth/br_sv.kmz
#6 Updated by Alister Hood about 9 years ago
Oh, I didn't see your reply, and had just found out about the libkml driver myself. It turns out there is a ticket for Windows:
One issue I found: when drag/drop of .zip file, there was a cyclical reopening of the ZIP layers dialog, after importing KML layers.
Do you use QGIS 1.8?
That sounds like #6225 (fixed in master)
#13 Updated by Jürgen Fischer almost 6 years ago
Salvatore Larosa wrote:
On Windows platform is not possible to load KMZ file (pointed out on the IT mailing list). GDAL from osgeo4w seem have not the LIBKML driver included. There is this ticket on the bug tracker 
Downstream issued fixed.