Changes between Version 5 and Version 6 of UserDocs/ReadInZip
- Timestamp:
- Mar 24, 2011, 11:26:00 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserDocs/ReadInZip
v5 v6 4 4 5 5 From 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) 6 The archive formats that are handled are single gzip'ed file (ending with .gz) and ZIP archives (ending with .zip). 7 7 8 8 This is implemented as 2 virtual file systems (like /vsimem for … … 10 10 Note 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) 11 11 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. 12 From GDAL 1.8.0, it is also possible to access a file inside a .tar (uncompressed) or 13 a .tar.gz/.tgz (compressed) archive 13 14 14 15 == How to use that capability with a gzip file ? == … … 27 28 28 29 A VSIStatL("/vsigzip/...") call will return the uncompressed size of the file. 30 31 The special file handler is [http://gdal.org/cpl__vsi_8h.html#3cde09f204df6f417653b7af4761178e VSIInstallGZipFileHandler ()] 29 32 30 33 == How to use that capability with a ZIP archive ? == … … 53 56 root, just mentionning "/vsizip/path/to/the/file.zip" will work. 54 57 58 The 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 62 Since GDAL 1.8.0, it is possible to access a file inside a .tar (uncompressed) or 63 a .tar.gz/.tgz (compressed) archive. The syntax is very similar to the /vsizip case : 64 65 {{{ 66 gdalinfo /vsitar/path/to/the/file.tar/path/inside/the/tar/file 67 }}} 68 69 or 70 71 {{{ 72 gdalinfo /vsitar/path/to/the/file.tar.gz/path/inside/the/targz/file 73 }}} 74 75 Note that reading a file in a .tar.gz archive is far less efficient than in a .zip file, 76 because in the .tar.gz case the whole archive is compressed, whereas in the .zip case, files 77 are compressed individually. So reading the last file in a .tar.gz archive requires to 78 uncompress all the files that are located before. 79 80 Reading a file in a .tar file will not expose that penalty. 81 82 The special file handler is [http://gdal.org/cpl__vsi_8h.html#d6dd983338849e7da4eaa88f6458ab64 VSIInstallTarFileHandler ()] 83 55 84 == Drivers supporting that capability == 56 85 57 86 The 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 87 that it will only work for GDAL drivers supporting the "large file API". A non-exhaustive 59 88 list of such drivers is : 60 89 * PNG … … 74 103 * EHdr 75 104 76 Other drivers may work too (I just looked for those advertizing the GDAL_DCAP_VIRTUALIO capability) 105 The full list can be obtained by looking at the driver marked with 'v' when running 'gdalinfo --formats'