[gdal-dev] Re: Hoe to convert ERDAS imagine(.img) files to ARC info ASCII files viceversa

Jason Roberts jason.roberts at duke.edu
Tue May 18 08:09:57 EDT 2010


On possible problem in this particular example is that the ArcInfo ASCII
Grid (AAIGrid) driver does not support the Create method of the GDAL API,
only the CreateCopy method, correct? (Please correct me if I am wrong about
this.) Therefore the procedure for converting IMG to ArcInfo ASCII Grid with
code will be slightly different than the one you outlined. C++, C, and
Python examples are here:
http://www.gdal.org/gdal_tutorial.html#gdal_tutorial_createcopy

Best regards,
Jason

-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org
[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Vincent Schut
Sent: Tuesday, May 18, 2010 5:19 AM
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Re: Hoe to convert ERDAS imagine(.img) files to ARC
info ASCII files viceversa

I've never used C#, mainly use python, but guess the process will be 
similar.
The idea is that you:
1) open your source dataset (the img file)
2) instantiate the arcinfo ascii driver (gdal.GetDriverByName in python 
to get a driver instance)
3) use the driver instance to create a new file with the correct 
parameters (size, #bands, datatype)
4) copy the metadata (projection, geotransform) from the input to the 
output file
5) read data from the input file
6) write data to the output file

Depending on the size of the file and the amount of memory, you might 
need to read/write in a loop per chunk or line instead of reading the 
whole shebang at once and writing after that.
About the details (in C#) I can't help you, you'll have to digg a bit 
yourself. Maybe there are some C# examples included in the gdal source code?

Good luck!
Vincent.

On 05/18/2010 11:05 AM, mail2vajram wrote:
> yeah..
> I saw that utility in the fwtools\bin folder.
> But it gives some error,when i added the reference to my C# project.
> Actually i need to do this task programatically. This class is available
in
> any other dll
> can u tell me please.
>
> thank you........
>    
_______________________________________________
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