[GRASSLIST:2556] Re: shade.rel.sh query

Markus Neteler neteler at itc.it
Fri Oct 5 05:46:42 EDT 2001

On Thu, Oct 04, 2001 at 12:56:04PM +0000, Kevin Slover wrote:
> morning,
>     I am trying (without success) to see what a color shaded raster will
> look like, but am having very little luck at this time.  The problem I
> seem to be having is that this cannot handle both neg and pos values in
> the same raster??  Looking at the range, they are all positive values,
> but the absolute values of the depths...is this true??  I have looked
> through the code, and that is what it appears somehow...
> also, is there a way to get a "gold" looking shade??
> an example of the color scheme is such:
> http://www.moc.noaa.gov/ru/images/b663dtm.jpg
> wondering if the hydrographers out there might have a scale for it already! Thanks!!


maybe you can change shade.rel.sh a bit and shift the range into
positive number space before continuing (so adding something at top
of the script)?

first get the minimum of the image using r.info or r.univar and
grep, then the shift
 newvalues = mapvalue + abs(minimum)

For a first try you perhaps perform this shift with r.mapcalc,
then run the unchanged shade.rel.sh. If working as expected, we
may consider to add this shift in shade.rel.sh in case negative
values occur. If needed I can easily change r.info to output
only the range (I would add a new flag). Let me know.

Markus Neteler

More information about the grass-user mailing list