Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3849 closed enhancement (fixed)

Add support for compressed ENVI rasters

Reported by: lpinner Owned by: warmerdam
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

Currently the ENVI driver raises an error when the "file compression" flag is set in a header file (source:/trunk/gdal/frmts/raw/envidataset.cpp#L1864).

Now that #1369 adds fairly transparent access to gzip/zip compressed files and #3799 implements the VSI*L API in the ENVI driver, would it be possible to add support for gzip compressed ENVI rasters?

Small compressed ENVI raster

Attachments (2)

test.gz (54.8 KB ) - added by lpinner 13 years ago.
test.hdr (642 bytes ) - added by lpinner 13 years ago.

Download all attachments as: .zip

Change History (6)

by lpinner, 13 years ago

Attachment: test.gz added

by lpinner, 13 years ago

Attachment: test.hdr added

comment:1 by lpinner, 13 years ago

Sorry, hit "Create Ticket" by accident. Last sentence is meant to read: Small compressed ENVI raster attached for testing.

Luke

comment:2 by Even Rouault, 13 years ago

Milestone: 1.8.0
Resolution: fixed
Status: newclosed

Support added in r21176

comment:3 by lpinner, 13 years ago

Thanks Even.

If I'm reading r21176 correctly, the test (line 1872) for a gzipped ENVI raster relies on the file extension "gz". Compressed ENVI rasters are _always_ gzip format, but the file extension can be anything or nothing at all. I only used ".gz" in my example raster for clarity.

Wouldn't it be better to rely solely on the file compression flag in the header? i.e if the flag is set, attempt to open using "/vsigzip/filename" and if that fails then warn the user that the raster is not compressed? Actually, this is how the ENVI software handles this.

comment:4 by Even Rouault, 13 years ago

r21180: envi: don't rely on image file extension to detect if it is compressed or not. Only use "file compression" attribute of .hdr file. Add test (#3849)

Note: See TracTickets for help on using tickets.