Repository navigation
r.out.gdal: increase limit for the number of overviews - #7865
Conversation
|
I see python3-gdal is missing as dependency for the tests. OK to add it? |
metzm
left a comment
There was a problem hiding this comment.
No objection from my side to increase the allowed number of overviews.
The smallest possible overview has a size of 1x1. With a large number of overviews requested, it can happen that the highest levels would result in no overviews. GDAL handles that correctly and only produces overviews down to 1x1 size. That means if 15 levels are requested, it can happen that only 9 levels, as in the added test, are produced, which is correct. Please add a test using the same input raster as in the current new test, but request 15 overview levels and check that the produced number of overview levels is < 15.
There is no need to add a test in the main code for a reasonable maximum number of overviews for a given raster/region as long as this is handled by GDAL.
|
In order to not increase the number of tests, you could also modify the newly introduced test, request 15 overviews and assert that 9 overviews are created. This ensures that more than 5 overviews are allowed and that GDAL handles an excess number of requested overview levels without error. |
|
Last suggestion: increase the allowed number of overviews to 30. The technical limit is given by the GDAL API with BuildOverviews() with the |
For large (e.g. country-wide) datasets, having mor than 5 overviews can be beneficial for viewing exported data in other systems.
The number of overviews
r.out.gdalis able to write was capped at 5 as a limit in GRASS, not GDAL.This PR increases that limit. It is now buped to15 overviews
r.out.gdalcan write to the resulting file. Happy to change the number to anything > 8 which I would consider a kind of minimal limit given todays dataset sizes...Changes are covered by a pytest.