raster maps

James Cameron cameron at stl.dec.com
Sun Oct 12 21:08:24 EDT 1997

Frank Lederer wrote:
> I have two raster layers, one with rivers, another with soil types. I
> want to separate the areas of the soil map, that are not crossed or
> touched by a river. Any suggestions how to perform this?

Yes, Frank.

Use the program r.mapcalc.

For example, if your rivers raster has category values 0 for not river,
and 1 for river, then simply invert and multiply ...

r.mapcalc 'drysoils=(1-rivers)*soils'

This will cause cells that contain a river to have a zero soil value.

There is also an "if" function that would achieve a similar effect.
See the manual pages for r.mapcalc.

You may also want to spread the rivers to cause nearby cells to be
included as well.  Can't remember off hand which r.program does that.

Hmm.  Thinking on what you said again ... you want to "separate the
areas".  Wondering if you mean to create a raster that describes areas
not touched by rivers.  ;-|

James Cameron                                    (cameron at stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

More information about the grass-user mailing list