[Qgis-developer] gdal and zip archives

John C. Tull jctull at gmail.com
Wed Nov 17 11:01:17 EST 2010

Hi all,

GDAL has support for reading raster files that are either zip or gzip archived. I've got many 24k topo maps that I would like to leave in their zip format to save hard drive space. GDAL on my system is capable of working on them, e.g., 'gdalinfo /vsizip/o35114a1.zip/o35114a1.tif' provides a summary of the raster properties.

Unfortunately, qgis does not know how to handle these files, at least on my system. As you can see in the gdal trac report ( http://trac.osgeo.org/gdal/ticket/1369 ), you have to prepend, in the example above, '/vsizip/ to the file name and append the actual file name that is inside the zip archive, unless it is the only file in the archive.

This is probably not very practical for qgis to try and guess the file inside the archive, nor does it make sense to ask the user every time one of these files is loaded. But, it is relatively trivial for the user to create a vrt for one or more source files within zip archives, e.g., 'gdal_translate -of vrt /vsizip/o35114a1.zip/o35114a1.tif o35114a1.vrt'. Although I would hope this file would work in qgis, it does not.

I tested in GRASS by running r.in.gdal on the vrt file as well as on /vsizip/o35114a1.zip/o35114a1.tif and it imported successfully both times. Could others test this on non-OSX systems to see if qgis handles this correctly for them? The file, about 1.5mb, that I used is available here:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20101117/ed9671b1/attachment.html

More information about the Qgis-developer mailing list