[gdal-dev] Overriding IRasterIO in class derived from
jorge.arevalo at gmail.com
Wed Aug 12 16:27:00 EDT 2009
2009/8/12 Tamas Szekeres <szekerest at gmail.com>:
> 2009/8/12 Jorge Arévalo <jorge.arevalo at gmail.com>
>> >> I'm afraid I have not quite followed the discussion of the IRasterIO
>> >> implementation, but I find the above statement quite alarming. It is
>> >> imperative that we *not* end up reading back all blocks if only a few
>> >> are requested. Imagine a 100GB image split up into blocks in a
>> >> table. If an application using GDAL is run and only needs a small
>> >> area of the file it is important that the blocks not requested never
>> >> be pulled from the DB.
>> > I can only second Frank's comment.
>> > IOW, general idea is to query minimum (sub)set of tiles requested,
>> > where request is based on spatial extent (i.e. geographic coordiantes)
>> > or extent within pixel space of a coverage (specified as range of rows
>> > and columns of a raster).
>> OK. Then, and correct me if I'm wrong, the point is to query only the
>> extent asked by the program using GDAL driver. Then, I should query
>> only the blocks requested in, for example, the IReadBlock method, just
>> as I did. But Tamas' suggestion was to minimize the number of server's
>> rounds implementing a kind of cache system at driver's level.
> I may have been misunderstood somewhere, but I've never talked about the
> requirement to fetch all the data (the entire extent) of the raster data
> We have been talking about fetching all the tiles requested by a single
> RasterIO call which tiles would definitely be requested by the subsequent
> IReadBlock calls if we were rely on the default RasterIO implementation.
> Just like what the WCS driver currently implements in DirectRasterIO to
> prevent from accessing the server for each tiles.
Yes, of course. The idea of fetching all the data covered by the
extent of the raster was my (wrong) own suggestion.
In WCS, RasterBand::IRasterIO calls Dataset::DirectRasterIO, that
constructs exactly one GetCoverage petition for the given window,
instead of constructing one petition for each small block.
My generalization was to create a single query to get all the extent
of the raster after opening the dataset, instead of all the extent
needed in a IRasterIO call.
That was the error. I'm sorry.
Then, I should follow my first option: override the IRasterIO method
in RasterBand class (and in Dataset too, I suppose).
> Best regards,
More information about the gdal-dev