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

Tim Keitt tkeitt at gmail.com
Tue May 18 14:46:52 EDT 2010


Oops. Sorry folks. It works after a small bug fix in the algorithm.

THK

On Tue, May 18, 2010 at 11:40 AM, Frank Warmerdam <warmerdam at pobox.com> wrote:
> 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.
>
> Tim,
>
> 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
>
>



-- 
Timothy H. Keitt
http://www.keittlab.org/


More information about the gdal-dev mailing list