-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gdalwarp -ovr {absolute_value} doesn't influence choice of output resolution #10174
Comments
Probably only when |
yes |
I had a look to the issue, first of all there here is a failing test case: diff --git a/autotest/utilities/test_gdalwarp.py b/autotest/utilities/test_gdalwarp.py
index df8cb2d65b..d9c6cf9f1f 100755
--- a/autotest/utilities/test_gdalwarp.py
+++ b/autotest/utilities/test_gdalwarp.py
@@ -1113,6 +1113,14 @@ def test_gdalwarp_40(gdalwarp_path, tmp_path):
assert ds.GetRasterBand(1).Checksum() == cs_ov0
ds = None
+ # Should select overview 0
+ gdaltest.runexternal(f"{gdalwarp_path} {src_tif} {dst_tif} -overwrite -ovr 0")
+
+ ds = gdal.Open(dst_tif)
+ assert ds.GetRasterBand(1).Checksum() == cs_ov0
+ ds = None
+
+ What happens here is that the output raster resolution is calculated from the input raster without taking care of the specified overview (this does not happen with Now I am struggling to find what is the best solution without breaking the API ( The logic which determines the resolution based on the overview level is deep inside |
isn't it a matter of moving code a bit inside GDALWarpDirect() so that the call to CreateOutput() done at line 2507 works on the poSrcOvrDS compute at line 2854 instead of the original pahSrcDS[] ? |
Fix OSGeo#10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix OSGeo#10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix OSGeo#10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix OSGeo#10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix OSGeo#10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix #10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix #10174 -ovr {absolute_value} doesn't influence choice of output resolution
Fix #10174 -ovr {absolute_value} doesn't influence choice of output resolution
Cf https://lists.osgeo.org/pipermail/gdal-dev/2024-June/059079.html
gdalwarp -ovr 0 -overwrite input.tif output.tif
should take into account the resolution of the 1st overview level of the input dataset to compute the output datasetThe text was updated successfully, but these errors were encountered: