- Does rasterio.warp.reproject use overviews?
Re: Does rasterio.warp.reproject use overviews?
toggle quoted messageShow quoted text
1. Correct. To use overviews, you must pass a dataset explicitly opened on an overview using `rasterio.open("example.tif", OVERVIEW_LEVEL=1)`.
2. Correct again. We'll add an option to use an automatically determined source file overview, as gdalwarp does.
Thank you for your response.
Is it correct to interpret from your explanation that:
1- currently the reproject function will never use overviews of the source file, even when it involves downsampling.
2- In a future version `reproject()` will eventually use source file overviews. (and the user will be able to control that behavior via an argument (e.g. overviewLevel= as in gdal python API)?)
To provide some context about why I want to know that, I'm warping 10 m sentinel2 data to a 20 m grid and I want to make sure it does *not* use the source file overviews. Overviews are fine for visualization but often not suitable
for analysis (unless they have been generated with the right resampling algorithm).
I read that the gdalwarp command line defaults to using the overview level nearest to target resolution. What about `rasterio.warp.reproject()`? Does it use overview at all?
Thank you and kind regards,
gdalwarp's logic is found in apps/gdalwarp_lib.cpp, not in gcore, so rasterio.warp.reproject() does not have it. We've got a rasterio ticket about switching over to use the main function in apps/gdalwarp_lib.cpp so that the behavior of rasterio.warp.reproject()
is exactly the same as gdalwarp, but haven't started work on it yet.
Join firstname.lastname@example.org to automatically receive all group messages.