Hmmm, I was under the impression that GRASS automatically resamples
the data to match the current region settings and then resamples
again to match the display device. So for display purposes you
shouldn't need to explicitly resample your data layer if
your current region is set to 10m resolution - and you've
d.erase'd
As to what resampling technique is used,
I've found references to nearest neighbor resampling in the
manuals, but it's not entirely clear to me if this is the one
and only technique used. I hope someone can clarify this...
Which raises an issue I've been wondering about. If my
understanding is correct, since most of the GRASS routines observe
the region settings, unless all one's data is identical with respect
to the region settings, resampling is being done extensively.
Is this true?
If so, what kinds of error are introduced and how does one
track the error associated with combining, mapcalcing or
otherwise analyzing multiple layers at different resolutions?
If this isn't true then how do r.combine and r.mapcalc process
raster layers with different resolutions?
Andrew Hertz
hertz@geog.psu.edu
I had a discussion with Michael Shapiro last year about this resampling
issue on grassu(13th Oct 92).
This is what he said:
Both r.mapcalc and r.neighbors will do the same thing and
resample the input the same way. If you start with a map with
50x50 meter grid cells (and the region is also 50x50) then you
will get a 50x50 output map with each cell as the average of the
neighboring cells (3x3, 5x5, 11x11 or whatever you specify). If
you want 3x3 average, but you want the output to be 150x150 meter
grid cells, first run the average (using r.neighbors or
r.mapcalc) with a 3x3 window and a 50x50 grid cell region. You
will get a map that is 50x50 meter resolution. Then change the
region to 90 meter grid cells and run r.resample to get a map
that is 90x90 meter resolution.
GRASS ALWAYS resamples as follows: go to the center of the grid
cell for the current region, compute the coordinates, find the
grid cell that contains these coordinates, look in the map and
extract the value in that grid cell and that value represents the
value for the "output" grid cell for the current region.
Neither r.neighbors nor r.mapcalc change the region grid cell size.
On 14th Oct 92 Michael added these facts about d.rast.
d.rast does a double resampling. First it reads the raster map thru
the current region (resampling as it does this according to the rule
described below). Then it resamples again to fit the image to the number of
pixels on the screen. It uses same kind of resampling as the first
to do this.
I hope this helps. It explained some things for me at least.
Lars
Lars Schylberg Email: larss@fmi.kth.se
Dept. of Geodesy and Photogrammetry
Royal Institute of Technology (KTH) Tel. +46 8 790 86 33
S-100 44 STOCKHOLM, SWEDEN Fax. +46 8 790 66 10