Bug report #3340

Raster clipper: shifted results

Added by alobo - over 13 years ago. Updated about 13 years ago.

Assignee:Giuseppe Sucameli
Category:GDAL Tools
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
be performed.

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:




#1 Updated by Giuseppe Sucameli about 13 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Done in 4d3cdeca (SVN r15699). Using translate instead of merge the corners of the extent are moved to pixels.

Also available in: Atom PDF