Bug report #3340
Raster clipper: shifted results
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||13400|
I think the way the area to be clipped is set in raster/clipper is wrong.
Currently, for results to be correct, the area to be clipped must be
coincident with pixel boundaries. In other
words, the 4 corners must be pixel corners.
If the corners of the defined area are within the pixel, the result is
shifted, as it is not interpolated.
I think that if no interpolation is the goal, then the coordinates
entered by the user should be moved to the closest
pixel corners, and the user be warned. Then the clipping would be exact.
If floating clipping is the goal, then the user must enter the
resolution of the new raster and interpolation must
Obviously having the option would be the best, but as the second
option is more complicated, having the first one
implemented first would make a lot of sense.
I've put a zipped file with a qgis project and layers to illustrate
the problem here: