[GRASS-dev] how link the function

Markus Neteler neteler at osgeo.org
Mon May 18 14:55:31 EDT 2009


On Mon, May 18, 2009 at 8:28 PM, Quentin Page
<quentin.page at avignon.inra.fr> wrote:
> hi
>
> i have problems with 2 or more function when i wrote in the samle line.
>
> how can we make nested function simply by using the functionality of grass
> eg : erosion
>
> /r.mapcalc "partieOK=if(r.neighbors input=247general at ventoux_sud_quentin
> method=diversity size=3)>1,247general at ventoux_sud_quentin,9)"

You cannot combine commands like this:
- r.mapcalc has its own syntax (see g.manual r.mapcalc)
- r.neighbors is a separate command

Possible Solution (untested, compiled from your example):
- run first r.neighbors with output
  r.neighbors input=247general at ventoux_sud_quentin method=diversity
size=3 output=237diversity

- then run r.mapcalc, using this output
  r.mapcalc "partieOK=if(237diversity >1, 247general at ventoux_sud_quentin, 9)"

Hope this helps,
Markus


More information about the grass-dev mailing list