[GRASS-dev] using slope/aspect functions inside our module

Dylan Beaudette dylan.beaudette at gmail.com
Mon Jul 9 16:25:34 EDT 2007


On Monday 09 July 2007 13:04, Helena Mitasova wrote:
> On Jul 9, 2007, at 3:47 PM, Dylan Beaudette wrote:
> > On Wednesday 04 July 2007 08:41, Glynn Clements wrote:
> >> "Carlos \"Guâno\" Grohmann" wrote:
> >>> Interesting.
> >>> Why r.slope.aspect uses
> >>>
> >>> dx = ... / (4 * ewres);
> >>>
> >>> while r.shaded.relief uses
> >>>
> >>> dx = ... / (8 * ewres);
> >>>
> >>> ??
> >>
> >> Oops. It should be 8; the ewres/nsres values are actually the
> >> distances between the centres of the top/bottom rows and left/right
> >> columns in the 3x3 window, which are two rows/columns apart. IOW, the
> >> 4*ewres should have been 4*(2*ewres) = 8*ewres, ditto for nsres.
> >
> > Yikes, does this mean that previous calculations are now wrong?
>
> no - it is correctly implemented - you would have found that it is
> wrong by now.
> It is just that the variable that you divide with in the r.slope.aspect
> uses 2*ewres (twice the resolution, not just one as is usual in
> the published equations) - I got caught on that many times when checking
> the r.slope.aspect code.
>
> Helena

Thanks for the quick reply! That is a relief (! no pun intended there). 

Cheers,

Dylan








More information about the grass-dev mailing list