Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2580 closed enhancement (fixed)

Read EHdr file(s) directly from a zip archive

Reported by: apetkov Owned by: Even Rouault
Priority: normal Milestone: 1.6.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: ehdr large file api
Cc:

Description

I am interested in using the functionality to read rasters directly from compressed archives (see http://www.nabble.com/Support-for-reading-GDAL-datasets-in-compressed-archives-(.gz-and-.zip)-td19152179.html).

The EHdr driver, however, is not among those that support the "large file API".

The attached patch adds support for reading via the "large file API", and advertisement for the GDAL_DCAP_VIRTUALIO capability, so EHdr files can be read directly from compressed archives.

Example:

gdalinfo /vsizip/nd050707.zip/nd050707.bil

NOTE: The "large file API" changes apply only to the reading portions of the driver. I kept the write portion of the driver unchanged.

Attachments (1)

ehdr_read_from_compressed_archives.patch (9.2 KB) - added by apetkov 9 years ago.
Updated patch with complete large file API support

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by apetkov

Updated patch with complete large file API support

comment:1 in reply to:  description Changed 9 years ago by apetkov

Summary: Read EHdr file(s) directly from a zip archiveRead EHdr file(s) directly from a zip or a gz archive

Replying to apetkov:

NOTE: The "large file API" changes apply only to the reading portions of the driver. I kept the write portion of the driver unchanged.

I changed the EHdr driver to use the large file API and updated the patch.

comment:2 Changed 9 years ago by apetkov

Summary: Read EHdr file(s) directly from a zip or a gz archiveRead EHdr file(s) directly from a zip archive

comment:3 Changed 9 years ago by Even Rouault

Component: defaultGDAL_Raster
Keywords: ehdr large file api added
Owner: changed from warmerdam to Even Rouault
Status: newassigned

I'll review that

comment:4 Changed 9 years ago by Even Rouault

Resolution: fixed
Status: assignedclosed

Patch applied in r15425. Test added in r15426. I've also changed CPLFormCIFilename in r15424 to use large file API.

Thanks

comment:5 Changed 9 years ago by apetkov

Just a quick note that might help someone--using absolute path to the zip archive works also, but one needs 2 slashes (ie '') after the vsizip keyword. This is on linux, not sure how that applies to Windows.

comment:6 Changed 9 years ago by Even Rouault

It was explained in the wiki (but only for /vsigzip) : http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip

So I added a note for /vsizip too.

Feel free to contribute to the wiki.

Note: See TracTickets for help on using tickets.