[gdal-dev] Reading ArcInfo binary grids with the R rgdalpackage fails with "GDAL Error 3: Attempt to read past EOF in..../arc.dir"

Gregory, Matthew matt.gregory at oregonstate.edu
Wed Jul 22 12:09:28 EDT 2009


Hi Jason,

Jason Roberts wrote:
> Markus - thanks for the links to those tickets. Those tickets 
> seem to imply this is a minor annoyance. Unfortunately, for 
> me, it means I can't read the grids at all from R. Perhaps if 
> I was using the C interface there would be a workaround (just 
> ignore the error?) but this is not possible using the R 
> interface, as far as I can tell. For example, the rgdal 
> GDAL.open API fails with the same message.

I was one of the people that wrote up a ticket on this.  Ironically, it
looks like it was a bug fix that Even implemented (rev. 16460) that
allowed the INFO directory to be read correctly (so that the VAT is
read), which exposed the source of these errors.  

> Is the right solution to get the rgdal developers to code a 
> workaround to ignore the error somehow? Or is it to determine 
> the underlying problem in GDAL? Or perhaps ESRI is generating 
> grids that violate the AIG format specification?

I hadn't worked with this outside of the C interface, but I'm noticing
now that the same problems crop up in the Python bindings:

  >>> from osgeo import gdal
  >>> ds = gdal.Open("D:/matt/vat_test/grid1")
  ERROR 3: Attempt to read past EOF in
D:/matt/vat_test/grid1/../info/../grid1/vat
  .adf.
  >>> type(ds)
  <type 'NoneType'>

So it seems like either all bindings need to silently ignore this error
or have it fixed in the GDAL source.  I'll admit that my understanding
of what really needs to happen is often shaky ...

matt


More information about the gdal-dev mailing list