[Gdal-dev] Using CreateCopy() with ENVI data

Wim Koolhoven koolhoven at itc.nl
Mon Mar 14 12:13:22 EST 2005


Frank,

Most users want same input format as output. 

A function ENVIDataset::Create() is defined, but
ENVIDataset::CreateCopy() seems not to be present. Is this a virtual
function which can just be created?

Can I implement the function that I only implement it for when the input
dataset is also ENVI and in all other cases call the default
implementation? I only have seen complete implementations.


regards,

Wim Koolhoven

 

-----Original Message-----
From: Frank Warmerdam [mailto:fwarmerdam at gmail.com]
Sent: maandag 14 maart 2005 17:19
To: Wim Koolhoven
Cc: gdal-dev at remotesensing.org
Subject: Re: [Gdal-dev] Using CreateCopy() with ENVI data

On Mon, 14 Mar 2005 16:54:06 +0100, Wim Koolhoven <koolhoven at itc.nl>
wrote:
> > Hi All,
> >
> > In a specific project the client uses ENVI data with a program we 
> > wrote based on GDAL.
> >
> > The input is read, processed and written to a new dataset. The new 
> > datasat is created with CreateCopy(). Unfortunately class names, 
> > colors and coordinate information get lost with CreateCopy().
> >
> > Quick and dirty solution would be to copy the .hdr file our selves, 
> > but that makes our program dependent on ENVI. Any other ideas?

Wim,

Is the output also ENVI format?  The short answer is that the solution
would be to improve the ENVI driver to support all these objects you
want to preserve.  The ENVI driver was just hacked together as a quick
way of getting at imagery with ENVI headers, and is by no means feature
complete. 

I would add that a CreateCopy from ENVI to ENVI should preserve the
geotransform based on a very quick skim of the envi code.  If that isn't
happening it might be considered a bug.  The ENVI code is in
gdal/frmts/raw/envidataset.cpp if you are inclined to try and improve
it.  

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