Changes between Version 15 and Version 16 of UserDocs/ReadInZip


Ignore:
Timestamp:
Oct 2, 2017, 5:21:14 PM (7 years ago)
Author:
Mike Taves
Comment:

modify title (since there are other archive formats now supported); fixed-formatting for code

Legend:

Unmodified
Added
Removed
Modified
  • UserDocs/ReadInZip

    v15 v16  
    1 = Reading a GDAL dataset in a .gz file or a .zip archive =
     1= Reading a GDAL or OGR datasets in archive files =
    22
    33== Summary ==
     
    66The archive formats that are handled are single gzip'ed file (ending with .gz) and ZIP archives (ending with .zip).
    77
    8 This is implemented as 2 virtual file systems (like /vsimem for
    9 example), /vsigzip and /vsizip. From .zip files only read-only access is supported, while the /vsigzip driver supports read and sequential write.
     8This is implemented as 2 virtual file systems (like `/vsimem` for
     9example), `/vsigzip` and `/vsizip`. From .zip files only read-only access is supported, while the `/vsigzip` driver supports read and sequential write.
    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
     
    2121were path/to/the/file.gz is relative or absolute.
    2222
    23 If the path is absolute, it should begin with a / on a Unix-like OS (or C:\ on Windows), so the line looks like /vsigzip//home/gdal/...
     23If the path is absolute, it should begin with a `/` on a Unix-like OS (or `C:\` on Windows), so the line looks like `/vsigzip//home/gdal/...`
    2424
    2525The first time that a .gz file is read, a small .gz.properties file will be
     
    2727following opening of that dataset much faster.
    2828
    29 A VSIStatL("/vsigzip/...") call will return the uncompressed size of the file.
     29A `VSIStatL("/vsigzip/...")` call will return the uncompressed size of the file.
    3030
    3131The special file handler is [http://gdal.org/cpl__vsi_8h.html#3cde09f204df6f417653b7af4761178e VSIInstallGZipFileHandler ()]
     
    4040the relative path to the file inside the archive.
    4141
    42 If the path is absolute, it should begin with a / on a Unix-like OS (or C:\ on Windows), so the line looks like /vsizip//home/gdal/...
     42If the path is absolute, it should begin with a `/` on a Unix-like OS (or `C:\` on Windows), so the line looks like `/vsizip//home/gdal/...`
    4343
    44 For example gdalinfo /vsizip/myarchive.zip/subdir1/file1.tif
     44For example `gdalinfo /vsizip/myarchive.zip/subdir1/file1.tif`
    4545
    4646The ReadDir() method is implemented for the .zip archives, so a driver will be
     
    4949file and all its NITF tiles.
    5050
    51 A VSIStatL("/vsizip/...") call will return the uncompressed size of the file.
     51A `VSIStatL("/vsizip/...")` call will return the uncompressed size of the file.
    5252Directories inside the ZIP file can be distinguished from regular files with
    5353the VSI_ISDIR(stat.st_mode) macro as for regular file systems.
    5454
    5555Small syntaxic sugar : if the .zip file contains only one file located at its
    56 root, just mentionning "/vsizip/path/to/the/file.zip" will work.
     56root, just mentionning `/vsizip/path/to/the/file.zip` will work.
    5757
    5858The special file handler is [http://gdal.org/cpl__vsi_8h.html#884fac3cd6be2c09deb807e959d78b3a VSIInstallZipFileHandler ()]
     
    6161
    6262Since 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 :
     63a .tar.gz/.tgz (compressed) archive. The syntax is very similar to the `/vsizip` case :
    6464
    6565{{{
     
    112112  * EHdr
    113113
    114 The full list can be obtained by looking at the driver marked with 'v' when running 'gdalinfo --formats'
     114The full list can be obtained by looking at the driver marked with 'v' when running `gdalinfo --formats`
    115115
    116116= vsicurl - to read from HTTP or FTP files (partial downloading) =