Changes between Version 5 and Version 6 of UserDocs/ReadInZip


Ignore:
Timestamp:
Mar 24, 2011, 11:26:00 AM (13 years ago)
Author:
Even Rouault
Comment:

update with /vsitar

Legend:

Unmodified
Added
Removed
Modified
  • UserDocs/ReadInZip

    v5 v6  
    44
    55From GDAL 1.6.0, it is possible to access a GDAL dataset inside a compressed archive and read it on-the-fly.
    6 The archive formats that are handled are single gzip'ed file (ending with .gz) and ZIP archives (ending with .zip)
     6The archive formats that are handled are single gzip'ed file (ending with .gz) and ZIP archives (ending with .zip).
    77
    88This is implemented as 2 virtual file systems (like /vsimem for
     
    1010Note that performance will not be very impressive, as random access inside gzip data is slow by nature, although some optimizations have been made to make it faster and generally usable ("snapshots" of the gzip state are taken from time to time, so that further access to a given offset inside the file just needs to restart decompression from the nearest snapshot)
    1111
    12 Note that .tar.gz archives are not supported, and there's no plan to support them as it is a very inappropriate format for seeking.
     12From GDAL 1.8.0, it is also possible to access a file inside a .tar (uncompressed) or
     13a .tar.gz/.tgz (compressed) archive
    1314
    1415== How to use that capability with a gzip file ? ==
     
    2728
    2829A VSIStatL("/vsigzip/...") call will return the uncompressed size of the file.
     30
     31The special file handler is [http://gdal.org/cpl__vsi_8h.html#3cde09f204df6f417653b7af4761178e VSIInstallGZipFileHandler ()]
    2932
    3033== How to use that capability with a ZIP archive ? ==
     
    5356root, just mentionning "/vsizip/path/to/the/file.zip" will work.
    5457
     58The special file handler is [http://gdal.org/cpl__vsi_8h.html#884fac3cd6be2c09deb807e959d78b3a VSIInstallZipFileHandler ()]
     59
     60== How to use that capability with a .tar or .tar.gz/.tgz archive ? ==
     61
     62Since GDAL 1.8.0, it is possible to access a file inside a .tar (uncompressed) or
     63a .tar.gz/.tgz (compressed) archive. The syntax is very similar to the /vsizip case :
     64
     65{{{
     66gdalinfo /vsitar/path/to/the/file.tar/path/inside/the/tar/file
     67}}}
     68
     69or
     70
     71{{{
     72gdalinfo /vsitar/path/to/the/file.tar.gz/path/inside/the/targz/file
     73}}}
     74
     75Note that reading a file in a .tar.gz archive is far less efficient than in a .zip file,
     76because in the .tar.gz case the whole archive is compressed, whereas in the .zip case, files
     77are compressed individually. So reading the last file in a .tar.gz archive requires to
     78uncompress all the files that are located before.
     79
     80Reading a file in a .tar file will not expose that penalty.
     81
     82The special file handler is [http://gdal.org/cpl__vsi_8h.html#d6dd983338849e7da4eaa88f6458ab64 VSIInstallTarFileHandler ()]
     83
    5584== Drivers supporting that capability ==
    5685
    5786The fact that this new capability is implemented as virtual file systems imply
    58 that it will only work for GDAL drivers supporting the "large file API". A
     87that it will only work for GDAL drivers supporting the "large file API". A non-exhaustive
    5988list of such drivers is :
    6089  * PNG
     
    74103  * EHdr
    75104
    76 Other drivers may work too (I just looked for those advertizing the GDAL_DCAP_VIRTUALIO capability)
     105The full list can be obtained by looking at the driver marked with 'v' when running 'gdalinfo --formats'