[GIS] Can QGIS open KMZ files

kmzqgiswindows xp

I know I can add KML files once I have unzipped the KMZ files, but is there a way to open KMZ files directly?

When I try to open a kmz file on QGIS 1.8.0 on Windows XP, through the all files filter, it does not accept it as a valid format.

Am I doing something wrong?

Does this all depend on OGR support?

Best Answer

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. (Otherwise, you will need to decompress the .kmz to .kml files as noted by @Kurt)

enter image description here

If the .kmz has multiple layers, you will be presented with a layer selection dialog (single layer .kmz files are immediately loaded):

enter image description here

You can select multiple layers in that dialog to import. The Example Overlay of Multiple Datasets .kmz file I tested (from here) allowed multiple layer import of point, line and polygon layer types.


EDIT: You can check for ogr LIBKML driver support in your version of QGIS by running the following commands in QGIS's Python Console:

import osgeo.ogr
print 'Has LIBKML ogr driver: ' + str(osgeo.ogr.GetDriverByName('LIBKML') is not None)
Related Question