[GRASS-user] r.mapcalc and mode values / labeling raster values

Dear GRASS users,

maybe someone can answer my two questions...

1) I have a complex r.mapcalc construct containing a mode value calculation. So
what happens when there is more than one exclusive mode value in the expression
mode(a_1,...,a_n)? Random select? How to avoid it?

2) I always use the sequence r.stats [...] | awk [...] | r.reclass [...] to
reassign raster labels according to my wishes. Now I wonder if the
three-step-solution is the only one. For large raster maps the r.reclass part
takes very long. How to handle that?

Thanks a lot for your hints...!

Best regards,
Christian.

----------------------------------------------------------------
This mail was sent through http://webmail.uni-jena.de

Christian Schwartze wrote:

1) I have a complex r.mapcalc construct containing a mode value calculation. So
what happens when there is more than one exclusive mode value in the expression
mode(a_1,...,a_n)? Random select?

The highest value is returned.

How to avoid it?

If you want the lowest value, you can negate the arguments and the
result, i.e.:

  -mode(-a_1,..,-a_n)

If you want something else, you'll need to extend r.mapcalc.

2) I always use the sequence r.stats [...] | awk [...] | r.reclass [...] to
reassign raster labels according to my wishes. Now I wonder if the
three-step-solution is the only one. For large raster maps the r.reclass part
takes very long. How to handle that?

The size of the map shouldn't have any effect upon r.reclass, only the
number of categories. The size will affect r.stats, though.

--
Glynn Clements <glynn@gclements.plus.com>