[gdal-dev] Save/Update ENVI files

Frank Warmerdam warmerdam at pobox.com
Wed Jan 21 10:44:37 EST 2009


TSchilling OMW wrote:
> Hello,
> 
> 
> Iam new to GDAL and Iam writing actually a test application to get familiar
> with this library. In general Iam using GDAL only for reading and 
> writing ENVI files.
> 
> Iam reading ENVI files via:
> Dataset ds = Gdal.Open(EnviPath, Access.GA_Update);
> 
> My question is now: How to write back (update) the changes I made
> in the dataset into the ENVI (and .hdr) file ?

Torsten,

It is helpful to indicate your language of implementation if it is not
the default (C/C++).  I am guessing the above is c#, is that right?

Generally speaking you just need to release the dataset handle to close
it, and flush out any changes.   I would guess you can release the dataset
in C# by assigning null to the dataset.

eg.
   ds = null;

I would note that the ENVI format only supports in place update of the
image data.  Attempts to change the header using things like
SetGeoTransform(), and SetProjection() will not have any effect.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list