The ARC/Info file:
ncols 1
nrows 1
xllcorner 0.0000000000
yllcorner 0.0000000000
cellsize 0.0083333333
ycellsize 0.0083333333
nodata_value -32767
-32767
Results in an adfGeoTransform:
0.0
0.0083333333
0.0
0.0
0.0
-0.0083333333
but shouldn't it be
-0.0083333333 / 2.0
0.0083333333
0.0
0.0083333333 / 2.0
0.0
-0.0083333333
to reflect the definition of the adfGeoTransform reference point to be the upper left corner of the area of the upper left data point?
So I think in aaigriddataset.cpp (http://trac.osgeo.org/gdal/browser/branches/1.5/gdal/frmts/aaigrid/aaigriddataset.cpp#L444) the calculation is wrong.
444 if ((i = CSLFindString( papszTokens, "xllcorner" )) >= 0 &&
445 (j = CSLFindString( papszTokens, "yllcorner" )) >= 0 )
446 {
447 poDS->adfGeoTransform[0] = atof( papszTokens[i + 1] );
448 poDS->adfGeoTransform[1] = dfCellDX;
449 poDS->adfGeoTransform[2] = 0.0;
450 poDS->adfGeoTransform[3] = atof( papszTokens[j + 1] )
451 + poDS->nRasterYSize * dfCellDY;
452 poDS->adfGeoTransform[4] = 0.0;
453 poDS->adfGeoTransform[5] = - dfCellDY;
454 }
455 else if ((i = CSLFindString( papszTokens, "xllcenter" )) >= 0 &&
456 (j = CSLFindString( papszTokens, "yllcenter" )) >= 0 )
457 {
458 poDS->SetMetadataItem( GDALMD_AREA_OR_POINT, GDALMD_AOP_POINT );
459
460 poDS->adfGeoTransform[0] = atof(papszTokens[i + 1]) - 0.5 * dfCellDX;
461 poDS->adfGeoTransform[1] = dfCellDX;
462 poDS->adfGeoTransform[2] = 0.0;
463 poDS->adfGeoTransform[3] = atof( papszTokens[j + 1] )
464 - 0.5 * dfCellDY
465 + poDS->nRasterYSize * dfCellDY;
466 poDS->adfGeoTransform[4] = 0.0;
467 poDS->adfGeoTransform[5] = - dfCellDY;
468 }
I think both calculations are wrong. The (X|Y)LLCORNER defines the position of the dataset in the lower right corner, so we have to add the "half-pixel"-size offset here.
The (X|Y)LLCENTER seems to define the position of the center of the lower left tile of the dataset (defined by the 4 points in the lower left corner of the dataset). So we have to add "full-pixel"-size.
Michael