[GRASSLIST:2401] RE: shade.rel.sh

CHAN Kenneth ken.chan at tenix.com
Thu Sep 6 06:09:18 EDT 2001


> depending on elevation angle and azimuth, I got some 
> perfectly vertical
> or perfectly horizontal (or both) lines in my raster.  I was trying to
> figure out why this was happening, maybe an imperfection in the data??
> I am working with multibeam hydrographic data, so the data was pretty
> dense.  I tried a neighborhood analysis average (3X3) hoping maybe to
> smooth out the data set, but no help whatsoever...any ideas as to why
> this is happening...furthermore, I set r.colors = gyr, could this be a
> problem??  Does this only work with grey shading??

Kevin,

When I first used shade.rel.sh, my output contains what looks like contour
lines.  When I check the elevation in the different "bands" of lines, the
elevation difference between adjacent "bands" is 1 unit (1 metre).  You
might want to check the elevation on the line and on both sides of the line.

To get rid of the "contour lines" on my output, I added a "threshold" value
to limit the script's response to minor elevation differences.  Here is the
part of shade.rel.sh I modifed:

>>>>>>>>>>>>>
r.mapcalc << EOF
shade = eval( \\
 x=($elev[-1,-1] + 2*$elev[0,-1] + $elev[1,-1] \\
   -$elev[-1,1] - 2*$elev[0,1] - $elev[1,1]), \\
 y=($elev[-1,-1] + 2*$elev[-1,0] + $elev[-1,1] \\
   -$elev[1,-1] - 2*$elev[1,0] - $elev[1,1]), \\
 x=if(x<-$filter||x>$filter,x/(8.*$ewres)),
y=if(y<-$filter||y>$filter,y/(8.*$nsres)), \\
 y=if(x!=0,y), x=if(y!=0,x), \\
 slope=90.-atan(sqrt(x*x + y*y)), \\

I arrived at a filter value of 4 through trail and error.  


----------------------------------------------------------------------------
----------------------------------------
Kenneth Chan
Software Developer, Simulation Group
Systems Division, Tenix Defence PTY LTD
Level 5, 100 Arthur St.
North Sydney
NSW   2060    
Australia.
Ph:      +61 2 9963 9726
Fax:     +61 2 9964 0988
Mobile:  +61 413 043474



More information about the grass-user mailing list