Opened 18 years ago

Last modified 17 years ago

#1198 closed defect

GDAL error reading ESRI binary GRIDs with > 1 tile index file — at Version 4

Reported by: jctoney@… Owned by: Mateusz Łoskot
Priority: normal Milestone: 1.4.2
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: aigrid
Cc: matt.wilkie@…

Description (last modified by warmerdam)

When the uncompressed size of an ESRI binary GRID dataset is near 2 GB, a second tile index file (e.g., w001000x.adf) is created which references a second raster data file (e.g., w001000.adf). This is true even if the actual run-length-encoded data size is well under 2 GB. ESRI support site refers to these as "multitiled" rasters in Article ID 27056:

"A multitiled raster is usually created when the number of cells times the number of bytes per cell is close to 2 GB. Multitiled raster can be identified by looking in the workspace folder. If there is more than one wNNNNNNx.adf (N = numeric value) file, then the raster is multitiled."

GDAL (1.3.1 and 1.3.2) returns an error when it attempts to read data referenced by the second tile index file, e.g.,

ERROR 1: IReadBlock failed at X offset 0, Y offset 5016
ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 5016

OpenEV will open these "multitiled" GRIDs, but does not correctly display the data referenced by the second tile index.

An example dataset (79470565.zip) is at: (slow)

ftp://ftp2.fs.fed.us/incoming/rmrs/missoula/ifsl/LANDFIRE/CToney_7.21.05/

or via http at:
http://www.spatialsimulation.org/LFDT/79470565.zip

Change History (5)

comment:1 by warmerdam, 18 years ago

Mateusz, 

Can you dig into this one. 

This Arc/Info binary grid format is a binary format that was reverse engineered.
The documentation is at:

  http://home.gdal.org/projects/aigrid/aigrid_format.html

The code in question is gdal/frmts/aigrid/aigopen.c and gridlib.c in the
same place.  You will need to work out how we are supposed to know when 
things split to multiple files (perhaps even by scanning the directory?)
and update the format docs and code accordingly. 

PS. the sample file is roughly 130MB!

If you run into problems, then wait for me to get back from my trip and I'll
help out or take this problem.  

comment:2 by Mateusz Łoskot, 18 years ago

I've just commited changes fixing this bug.

comment:3 by Mateusz Łoskot, 18 years ago

Ups! I'm sorry, I wanted to fix Bug 1195 but not this one. So, I'm reopening the Bug 1198. Sorry for confusing you.

comment:4 by warmerdam, 17 years ago

Description: modified (diff)
Milestone: 1.5.0
Priority: highnormal

by rengelke, 17 years ago

Attachment: gridlib.c added

source code

Note: See TracTickets for help on using tickets.