this bug's URL: http://intevation.de/rt/webrt?serial_num=4076

-------------------------------------------------------------------------

Subject: r.bilinear: does it work correctly ?

Platform: WindowsNT/2000/XP

grass obtained from: Mirror of Trento site

grass binary for platform: Downloaded precompiled Binaries

GRASS Version: GRASS 6.0.0 (2005)

I did a comparison between latticeresample of arcinfo, that is supposed to work also with a bilinear algorithm and r.bilinear on the same area. The boundaries of both files are identical, i.e. the pixels should be comparable.

I made a resampling of a DEM from 25 to 10 m. Then I compared the results of the two bilinear approaches. They are not identical. To illustrate the difference I give you the following example. Imagine four 25m input pixels. After the resampling you get 25 10m output pixels, where the central pixel (position 3,3 in the 5x5 field) is intersecting with all four original input pixels. Let's concentrate on this central output pixel. The distance from the center of this central output pixel to the centers of the four input pixels is equal to all four input pixels. So what I would expect is that the bilinear interpolation would give the average of all four input pixels. The altitudes of the four input cells are UL: 1912.09, UR: 1917.2, LL: 1925.8, LR: 1931.6. --> The average thus is 1921.68, which was also the result that was provided by latticeresample. The result of r.bilinear was 1922.25, which is a difference of more than half a meter. Since in the command reference of r.bilinea

r is written that only the 4 input cells are considered, I can not find an explanation why the result should be 1922.25 instead of 1921.68. I checked also the open bugs. I found the one with 0.5 rounding. Maybe my problem is linked to the previous one, but since I got a value of 1922.25 (not rounded to 0.5), I'm a little bit at a loss.

Best regards

Urs Gruber

-------------------------------------------- Managed by Request Tracker