reading Arc/Info Binary Grid

Robert Denham r.denham at f...
Wed Nov 8 01:04:05 EST 2000


Hi all,
thanks for a great library of code, I am looking forward to some
fun programming. 

My problem is with reading Arc/Info Binary Grids, and more specifically
with getting prjection information from them.

to get started I used code from the tutorial page to open and get
information on the coverage, but can't seem to get projection information.

The relevant bi of code is :
if (GDALGetProjectionRef (hDataset) != NULL)
printf ("Projection is `%s'\n", GDALGetProjectionRef (hDataset));

if (GDALGetGeoTransform (hDataset, adfGeoTransform) == CE_None)
{
printf ("Origin = (%.6f,%.6f)\n",
adfGeoTransform[0], adfGeoTransform[3]);

printf ("Pixel Size = (%.6f,%.6f)\n",
adfGeoTransform[1], adfGeoTransform[5]);
}

and the output is :
f2 [gdal]> ./test farah
Driver: AIGrid/Arc/Info Binary Grid
Size is 2895x2689x1
Projection is `'
Block=256x4 Type=Byte, ColorInterp=Undefined
Min=78.000, Max=238.000


So you can see DALGetProjectionRef (hDataset) returns an empty string, and
GDALGetGeoTransform (hDataset, adfGeoTransform) returns CE_failure.

Behaviour on imagine files seems ok:

f2 [gdal]> ./test /p11/riparian/dtms/coverages/64676964grdll.img
Driver: HFA/Erdas Imagine Images (.img)
Size is 967x1001x1
Projection is `PROJCS["UTM",GEOGCS["WGS 84",DATUM["WGS 84",SPHEROID["WGS
84",6378137,298.257223563002],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]'
Origin = (466999.500000,6965000.500000)
Pixel Size = (1.000000,-1.000000)
Block=64x64 Type=Float32, ColorInterp=Undefined
Min=0.000, Max=132.455
Band has 3 overviews.

Can anyone suggest what the problem might be?

Robert
------------------------------------
| Robert Denham |
| School of Mathematical Sciences |
| Queensland University of Technology |
| denham at f... |
------------------------------------






More information about the Gdal-dev mailing list