[GRASS-user] script for a multidirectional, oblique-weighted, shaded-relief image

David Finlayson david.p.finlayson at gmail.com
Mon Jun 5 18:20:32 EDT 2006


FOCALMEAN is just a smoothing kernel using the mean value of a 3x3 neighborhood

3 3 2
1 4 8 = (3 + 3 + 2 + 1 + 4 + 8 + 9 + 5 + 3) / 9 = 4.2
9 5 3

I think you can get the same effect by using r.neighbors:

r.neighbors in=<ingrid> out=<outgrid> method=average size=3

On 6/4/06, maning sambale <emmanuel.sambale at gmail.com> wrote:
> Hello,
>
> I found an article creating a multidirectional, oblique-weighted,
> shaded-relief image from the USGS
> (http://pubs.usgs.gov/of/1992/of92-422/of92-422.pdf).
>
> I basically creates a hillshade using different illumination angles.
> This is especially useful in very mountainous areas.  I tried to
> recreate  this with GRASS but having difficulty with r.mapcalc
> equations.
>
> Heres what I've made so far:
>
> # Multidirectional, oblique-weighted, shaded-relief image
>
> # Compute hillshade at azimuth 225, 270, 315 and 360 at 30 degrees sun
> illumination angle
> r.shaded.relief map=DEM_90 at PERMANENT shadedmap=shade225 altitude=30
> azimuth=225 zmult=1 scale=1
> r.shaded.relief map=DEM_90 at PERMANENT shadedmap=shade270 altitude=30
> azimuth=270 zmult=1 scale=1
> r.shaded.relief map=DEM_90 at PERMANENT shadedmap=shade315 altitude=30
> azimuth=315 zmult=1 scale=1
> r.shaded.relief map=DEM_90 at PERMANENT shadedmap=shade360 altitude=30
> azimuth=360 zmult=1 scale=1
>
> # compute aspect map
> r.slope.aspect elevation=DEM_90 at PERMANENT format=degrees prec=float
> aspect=aspect zfactor=1.0 min_slp_allowed=0.0
>
> # Resample aspect map
> # compute focalmean
> ???
>
> # compute weights 225, 270, 315 and 360
> # this is the basic formula how in r,mapcalc?
> r.mapcalc
> w225 = sin2(aspect - 225°)
> w270 = sin2(aspect - 270°)
> w315 = sin2(aspect - 315°)
> w360 = sin2(aspect - 360°)
>
> #compute weighted hilshaded
> r.mapcalc weightedshaded = (((w225 * shade225) + (w270 * shade270) +
> (w315 * shade315) + (w360 * shade360))/2)
>
> Any ideas?
>
> thanks,
>
> maning
> --
> |---------|----------------------------------------------------------|
> | __.-._  |"Ohhh. Great warrior. Wars not make one great." -Yoda     |
> | '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|
> |  /'.-c  |Linux registered user #402901, http://counter.li.org/     |
> |  |  /T  |www.esambale.wikispaces.com|
> | _)_/LI  |www.geocities.com/esambale/philbiodivmap/philbirds.html   |
> |---------|----------------------------------------------------------|
>
> _______________________________________________
> grassuser mailing list
> grassuser at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassuser
>


-- 
David Finlayson




More information about the grass-user mailing list