[Gdal-dev] Re: image data flushing (clean rebuild needed)

Frank Warmerdam warmerdam at pobox.com
Tue Mar 18 01:11:23 EST 2003


Gillian Walter wrote:
> Hi Frank,
> 
> I tried that, and now everything except the last line of the last band gets
> flushed.  This still
> doesn't flush even if I loop through the bands twice.  Does something else have
> to be freed to get the last line to flush?

Folks,

Gillian was encountering a problem where some formats implemented on top the
RawRasterBand and related classes were not properly fflushing data to disk
when the GDALRasterBand::FlushCache() method was called.

To correct this I made the GDALRasterBand::FlushCache() method virtual and
implemented it (to call VSIFFlussh()) for the RawRasterBand class.   As
a result of changing the method to be virtual anyone updating GDAL from CVS
should do a clean build (make clean; make).  Any change to the virtual
function table requires a complete recompile.

Anyone implementing formats that they wish to support the flushcache semantics
properly ... that is that should leave the dataset in a clean fully flushed to
disk state after a FlushCache() call should consider whether they need to
override the GDALRasterBand::FlushCache() or GDALDataset::FlushCache() methods
to do work like fflushing the stream they are writing on.

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