[gdal-dev] Support for reading GDAL datasets in compressed archives (.gz and .zip)

Even Rouault even.rouault at mines-paris.org
Wed Aug 27 14:34:19 EDT 2008


Le Wednesday 27 August 2008 15:58:54 Lucena, Ivan, vous avez écrit :
> Rouault,
>
> Nice job!
>
> Even Rouault wrote:
> > ----------------------------------
> > To read from a .gz file,
> > ----------------------------------
> > gdalinfo /vsigzip/path/to/the/file.gz were path/to/the/file.gz is
> > relative or absolute.
> >
> > The first time that a .gz file is read, a small .gz.properties file will
> > be generated (if possible) to capture the uncompressed data size. This
> > will make following opening of that dataset much faster.
>
> Suggestion:
>
> Would be interesting to bring the content of "file.gz" as subdatasets:
>
> Subdatasets:
>    SUBDATASET_1_NAME=/vsizip/myarchive.zip/subdir1/file1.tif
>    SUBDATASET_1_DESC=GeoTiff,100x110x1
>    SUBDATASET_2_NAME=/vsizip/myarchive.zip/subdir1/file2.tif
>    SUBDATASET_2_DESC=GeoTiff,100x110x1
>    SUBDATASET_3_NAME=/vsizip/myarchive.zip/subdir1/file3.tif
>    SUBDATASET_3_DESC=GeoTiff,100x110x1
>
> What do you think?

In fact a .gz file is just one single compressed file (I do not 
handle .tar.gz), so it does not make sense for that format.

It could make more sense for .zip files. But what you propose is not directly 
linked to zip files. It would be true of regular directories on 
the "classical" file system. And I'm not sure that all GDAL files under a 
directory can be considered as subdatasets of that directory. That behaviour 
should be clearly specified, and I think it belongs to the application level, 
not to the library one.

>
> > Small syntaxic sugar : if the .zip file contains only one file located at
> > its root, just mentionning "/vsizip/path/to/the/file.zip" will work.
>
> The same would apply to subdatasets, I guess.
>
> > The fact that this new capability is implemented as virtual file systems
> > imply that it will only work for GDAL drivers supporting the "large file
> > API". A list of such drivers is : PNG, JPEG, ILWIS, GTiff, GIF, JP2KAK,
> > NITF, ADRG, DTED, SRTMHGT, BMP, LCP, HFA (Erdas Imagine), AAIGRID. Other
> > drivers may work too (I just looked for those advertizing the
> > GDAL_DCAP_VIRTUALIO capability)
>
> That all we need? Nice!
>
> Best regards,
>
> Ivan




More information about the gdal-dev mailing list