[GRASS-user] Complex operations with r.mapcalc

Hi everyone,

I am requested to produce a new raster map from already available ones, with the purpose of ranking each cell according to some criteria, e.g., beauty. For instance, if a given cell contains vegetation, this should increase this ranking.

It seems appropriate to use r.mapcalc. However, what is unclear to me is how to sum up all contributions from the various maps, discriminating between categories within the single raster map.

Could you provide me with an example of this?

Thanks!

Fulvio
--
View this message in context: http://n2.nabble.com/Complex-operations-with-r.mapcalc-tp2563214p2563214.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Tue, Mar 31, 2009 at 4:21 PM, fulvio <fulvio.mastrogiovanni@unige.it> wrote:

Hi everyone,

I am requested to produce a new raster map from already available ones, with the purpose of ranking each cell according to some criteria, e.g., beauty. For instance, if a given cell contains vegetation, this should increase this ranking.

It seems appropriate to use r.mapcalc. However, what is unclear to me is how to sum up all contributions from the various maps, discriminating between categories within the single raster map.

Could you provide me with an example of this?

I think that this is easiest solved with the eval() function of r.mapcalc.
See for example the r.shaded.relief script in the scripts/ directory for
usage of eval(). It permits to define tmp variables on the fly and compose
a series of conditions and calculations into one r.mapcalc instruction.

Hope this helps
Markus