reducing grid size of elevation data

Lars Schylberg larss at fmi.kth.se
Thu Jul 29 10:48:16 EDT 1993


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 at 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







More information about the grass-user mailing list