Date 1 - 2 of 2
Handle to underlying GDAL dataset
toggle quoted message Show quoted text
It's not possible for a GDAL dataset handle to be shared between rasterio and GDAL's Python bindings. I discourage people from combining these modules. Unless one is extremely careful and understands the internals of each, it's a great way to create perplexing bugs.
Rasterio's dataset.read() works at a higher level than GDAL's DatasetReadAsArray(). The latter is effectively the C function that rasterio uses internally. Rasterio has data type and nodata checking overhead that GDAL's function lacks and perhaps some logic that could be more optimized. Is the overhead really 30%? Would you be willing to use Python's timeit to race the last two lines of your code against each other? I would expect the difference to diminish as the size of the window grows.
On Tue, May 4, 2021 at 7:15 AM soren.rasmussen via groups.io <email@example.com> wrote:
I would like to get a handle for the underlying GDAL dataset behind a RasterIO dataset.
Is this possible somehow?
The reason I want to do this is that, in some cases, GDAL operations are significantly faster. I have a case, where reading a subset of channels in a window with the just-released GDAL 3.3.0 is approximately 25% faster than RasterIO.
It would be nice to be able to use GDAL operations without having to open the dataset with both RasterIO and GDAL
(Note that band_list is new in GDAL 3.3.0)
|1 - 2 of 2|