Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5982 closed defect (invalid)

read zipped and gzipped EHdr files fail

Reported by: maphew Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.11.2
Severity: normal Keywords: zip, gzip
Cc:

Description

Reading of zipped and gzipped "EHdr/ESRI .hdr Labelled" data sets fails, presumably because the driver assumes a single file data source doesn't see the necessary associated .hdr file.

D:\t>dir /b
test.flt
test.hdr

D:\t>gdalinfo test.flt
Driver: EHdr/ESRI .hdr Labelled
Files: test.flt
       test.hdr
Size is 2015, 1223
Coordinate System is `'
Origin = (326000.000000000000000,1176200.000000000000000)
Pixel Size = (100.000000000000000,-100.000000000000000)
Corner Coordinates:
Upper Left  (  326000.000, 1176200.000)
Lower Left  (  326000.000, 1053900.000)
Upper Right (  527500.000, 1176200.000)
Lower Right (  527500.000, 1053900.000)
Center      (  426750.000, 1115050.000)
Band 1 Block=2015x1 Type=Float32, ColorInterp=Undefined
  NoData Value=-9

D:\t>gzip test.flt

D:\t>gdalinfo /vsigzip/test.flt
ERROR 4: `/vsigzip/test.flt' does not exist in the file system,
and is not recognised as a supported dataset name.

gdalinfo failed - unable to open '/vsigzip/test.flt'.
D:\t>gzip -d *

D:\t>zip test.zip *
  adding: test.flt (160 bytes security) (deflated 16%)
  adding: test.hdr (160 bytes security) (deflated 38%)

D:\t>gdalinfo /vsizip/test.zip
Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No such file or directory".
Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No such file or directory".
Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No such file or directory".
Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No such file or directory".
Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No such file or directory".
Warning 1: Recode from CP_OEMCP to UTF-8 failed with the error: "No such file or directory".
gdalinfo failed - unable to open '/vsizip/test.zip'.
Unable to open source `/vsizip/test.zip' directly.
The archive contains 2 files:
       /vsizip/test.zip/test.flt
       /vsizip/test.zip/test.hdr

Host: Win7 Pro x64, GDAL 1.11.2 from 32bit Osgeo4w.

Change History (2)

comment:1 Changed 7 years ago by Even Rouault

Resolution: invalid
Status: newclosed

/vsigzip/test.flt cannot work for datasets made of multiple files and for /vsizip/, you must explicitely point to the image file within the zip file, so /vsizip/test.zip/test.flt

$ gdalinfo /vsizip/byte_ehdr.zip/byte_ehdr.bin
Driver: EHdr/ESRI .hdr Labelled
Files: /vsizip/byte_ehdr.zip/byte_ehdr.bin
       /vsizip/byte_ehdr.zip/byte_ehdr.hdr
Size is 20, 20
Coordinate System is `'
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) 
Lower Left  (  440720.000, 3750120.000) 
Upper Right (  441920.000, 3751320.000) 
Lower Right (  441920.000, 3750120.000) 
Center      (  441320.000, 3750720.000) 
Band 1 Block=20x1 Type=Byte, ColorInterp=Undefined

comment:2 Changed 7 years ago by maphew

Note: See TracTickets for help on using tickets.