[gdal-dev] RasterIO(GF_Write,...) has no effect on copied dataset

Frank Warmerdam warmerdam at pobox.com
Tue May 18 12:40:41 EDT 2010

Tim Keitt wrote:
> I have some GDAL code that does:
> open input dataset
> create copy to output dataset
> close input dataset
> get raster band from output
> call RasterIO(GF_Read,...) on band
> update buffer in place
> call RasterIO(GF_Write,...) on band
> close output dataset
> exit
> The program runs, but the output dataset contains exactly the same
> values as the input dataset. The RasterIO(GF_Write,...) call seems to
> have no effect. I tried closing and reopening the output after the
> create copy call, but same result. Access of the copy is GA_Update.


That should work, assuming the output file supports in place update. Not
all drivers do support this.  What is the output format?

It *ought* to issue a clear error if it isn't supported, but this is an
area that has sometimes been handled in a lax manner.

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