[GRASS-user] resampling and patching DEM

Glynn Clements glynn at gclements.plus.com
Thu Nov 6 19:24:44 EST 2008


Silvia Simoni wrote:

> >> I need to patch dems with different resolutions (1x1m) and (2x2 m)  
> >> and
> >> resample them to a coarser resolution (10x10 m). Which is the correct
> >> procedure?
> >>
> >> a. resampling the 1x1 dem to 2x2 using r.resampl.stats -w (to be more
> >> accurate)
> >> patch them all at 2x2, resample the patched dem to 10x10m;
> >>
> >> b.resample the 1x1 and 2x2 dem to 10x10 m separately using
> >> r.resampl.stats -w, and then patch them all.
> >
> > In most cases, the most accurate approach is to set the region to 1x1,
> > patch (which will resample everything to 1x1 by nearest-neighbour),
> > then resample to 10x10 with r.resamp.stats.
> >
> > The problem with patching down-sampled data is that r.patch won't
> > merge partial results at the boundaries. It will simply discard choose
> > one value and discard the others.
> 
> Then why don't patch all 1x1 tiles together, resample them to 10x10  
> with r.resamp.stats, doing the same for the 2x2 tiles (patching and  
> resample), and finally patching the two obtained maps?

This is only safe if each 10x10 block is "full", i.e. the bounds of
the tiles are aligned to the 10x10 grid and none of the values are
null.

If you down-sample first then patch, any blocks which are partially
full in multiple maps will produce a separate aggregate for each map. 
The patching process will pick one value and discard the others.

If you patch first then down-sample, the aggregate will be computed
over the patched data.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list