[gdal-dev] gdal translate error converting ArcGRID binary to ASCII

Matt Wilkie matt.wilkie at gov.yk.ca
Wed Jun 4 17:52:04 EDT 2008


Hi Puneet,

No don't flatten the directories. ArcInfo expects a nested file 
structure. The following example is for an Arcinfo binary grid called 
"thegridname":

./log
./info/arc.dir
./info/arc0000.dat
./info/arc0000.nit
./info/arc0001.dat
./info/arc0001.nit
./thegridname/dblbnd.adf
./thegridname/hdr.adf
./thegridname/log
./thegridname/metadata.xml
./thegridname/prj.adf
./thegridname/sta.adf
./thegridname/vat.adf
./thegridname/w001001.adf
./thegridname/w001001x.adf

Some of the files are optional, and some are not used by gdal (the major 
one being the 'info' directory and contents). You can pare the list down 
to the following and gdal_translate will still work (though arcinfo will 
not):

./thegridname/dblbnd.adf
./thegridname/hdr.adf
./thegridname/prj.adf        # optional but desired projection info
./thegridname/sta.adf
./thegridname/w001001.adf
./thegridname/w001001x.adf


Based on your error message and example, the files were not created by 
ArcInfo as in Arc grid names cannot start with a number (that said, gdal 
doesn't care about that restriction). I would try renaming the files 
like this and try again:

./76980974/dblbnd.adf
./76980974/prj.adf
./76980974/w001001.adf
./76980974/hdr.adf
./76980974/sta.adf
./76980974/w001001x.adf

cheers,

matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------


P Kishor wrote:
> On 5/31/08, William Kyngesburye <woklist at kyngchaos.com> wrote:
>> On May 31, 2008, at 1:25 PM, P Kishor wrote:
>>
>>
>>> [01:45 PM] ~/Data/climate_change/cartagena_arcgrid$ ls
>> *.adf
>>> 76980974\76980974\dblbnd.adf*   76980974\76980974\prj.adf*
>>> 76980974\76980974\w001001.adf*
>>> 76980974\76980974\hdr.adf*      76980974\76980974\sta.adf*
>>> 76980974\76980974\w001001x.adf*
>>> [01:46 PM] ~/Data/climate_change/cartagena_arcgrid$
>> gdal_translate -of
>>> AAIGrid 76980974\\76980974\\w001001.adf out.grd
>>> ERROR 4: `76980974\76980974\w001001.adf' not recognised as a supported
>>> file format.
>>>
>>> GDALOpen failed - 4
>>> `76980974\76980974\w001001.adf' not recognised as a supported file format.
>>>
>>> I am on an Intel Macbook Pro with Mac OS X 10.5.3.
>>>
>>>
>>  One possibility is the backslashes - I see that often when downloading a
>> zip made on Windows and they expand into a flat file layout, but they
>> indicate a directory and file structure that GDAL may be expecting.  Try
>> removing the prefix of 'folders' from all the file names so it looks like:
>>
>>  dblbnd.adf
>>  hdr.adf
>>  prj.adf
>>  sta.adf
>>  w001001.adf
>>  w001001x.adf
>>
>>  and put it in a folder named '76980974'.
>>
> 
> I suspected as such, but instead of putting all of them in a single
> folder, I built a folder hierarchy as suggested by the back slashes (I
> am not really conversant with the ArcGRID file/folder structure).
> 
> I will flatten the list and try it again.
> 
> Thanks.
> 
> Puneet.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 



More information about the gdal-dev mailing list