[Gdal-dev] ENVIDataset::FlushCache is not idempotent for header file

Frank Warmerdam fwarmerdam at gmail.com
Mon Feb 28 10:40:37 EST 2005


On Sat, 26 Feb 2005 21:04:18 -0800, Carlos A. Rueda <carueda at ucdavis.edu> wrote:
> Hello Frank,
> 
> I have just noticed that multiple calls to FlushCache on an ENVI dataset
> object will generate a header with repeated header items. 

Carlos, 

Hmm, I think I see what you mean.  Can you submit a bug 
report with details.  It seems that we will need to alter the 
header writing logic to keep the whole header in RAM so that
it can be completely re-written in FlushCache(), not just 
appended to. 

Also, a recent change by Gillian, makes this a less
frequent problem since it is now only written when dirty.
But I think if you altered the projection, flushed, altered
the projection again and flushed you would end up with
duplicate items. 

> I also notice
> that the first call inside this method is to GDALDataset::FlushCache()
> but perhaps it should be to RawDataset::FlushCache().

True.  I have changed it. 

However, this does not currently make any difference as
there is no RawDataset::FlushCache() so it is just forwarded
to GDALDataset::FlushCache() anyways.  Just cleaner, 
future-safe coding to call the immediate parent classes method.

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