[Gdal-dev] ADF -> AAIGrid, "IReadBlock failed"

Patrick Min pmin00 at gmail.com
Tue May 29 10:22:54 EDT 2007


hi Frank,

Thanks for the reply. I wrote a Perl script to get some data
out of hdr.adf, etc., maybe this helps (see below). It seems there are
(475000 - 306840) / 5 = 33632 rows (as expected), but hdr.adf
says a tile is 4 pixels high, and HTilesPerColumn is 2520 (?!), which
should be 33632 / 4 = 8408, right?

Patrick


read_bounds_info(dblbnd.adf)
  LLX: [13565]
  LLY: [306840]
  URX: [269640]
  URY: [475000]

read_stats_info(sta.adf)
  SMin: [-8332]
  SMax: [34338]
  SMean: [1438.64260482693]
  SStdDev: [2390.48273559427]

read_header(hdr.adf)
  HMagic [GRID1.2]
  HCellType [1]
  HPixelSizeX [5]
  HPixelSizeY [5]
  unknown1 [-115075]
  unknown2 [399400]
  HTilesPerRow [201]
  HTilesPerColumn [2520]
  HTileXSize [256]
  unknown [1]
  HTileYSize [4]


On 5/29/07, Frank Warmerdam <warmerdam at pobox.com> wrote:
> I can't see what would be going on here.  If the input file is AAGRID
> format, and the file has 33632 rows, I don't know why nBlocksPerColumn
> would be 2520.   I think you would need to make the file available for
> this to be pursued - though it sounds painfully large.

> > This is the output I'm getting:
> > Input file size is 51215, 33632
> > 0...10...20...ERROR 1: Illegal block requested.
> > ERROR 1: IReadBlock failed at X offset 0, Y offset 2520
> > ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 2520
> >
> > I'm finding that "psInfo" holds a variable "nBlocksPerColumn",
> > which is set to 2520.
> > As soon as I request a row beyond 4 times that value
> > (i.e. I do gdal_translate -srcwin 0 10800 1 1, for example)
> > (which should be possible because the input data has 33632 rows)
> > it gives me the above error.



More information about the Gdal-dev mailing list