Opened 13 years ago

Closed 13 years ago

#3340 closed bug (fixed)

Raster clipper: shifted results

Reported by: alobo Owned by: brushtyler
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: GDALTools Version:
Keywords: Cc:
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

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:

https://sites.google.com/site/filestemp2/home/clip_problem.zip

Agus

Change History (5)

comment:1 by alobo, 13 years ago

Component: RastersPython plugins and bindings
Owner: changed from nobody to borysiasty

comment:2 by alobo, 13 years ago

Owner: changed from borysiasty to pcavallini

comment:3 by borysiasty, 13 years ago

Owner: changed from pcavallini to brushtyler

comment:4 by pcav, 13 years ago

Component: Python plugins and bindingsGDALTools

comment:5 by brushtyler, 13 years ago

Resolution: fixed
Status: newclosed

Done in r15698. Using translate instead of merge the corners of the extent are moved to pixels.

Note: See TracTickets for help on using tickets.