Helena Mitasova wrote:

> Over the years there have been changes in the formatting of r.mapcalc 
> expressions
> and it appears the currently there is no single way that would work everywhere
> (you either need quotes or it does not work with quotes and in GRASS6.4.3 the 
> space around = is not necessary).
> I have tried to summarize our experience on MSWindows, Mac and linux here
> 
> http://courses.ncsu.edu/mea582/common/GIS_anal_grass/mapcalcformats.html
> 
> My question about the document above - is this how it should work?

>From the command line, the most portable approach is to use:

        r.mapcalc "outmap = whatever"

That should work in any version on any platform.

GRASS 6 simply concatenates all arguments with a space between each
one, and uses the result as the expression.

GRASS 7 uses G_parser():

        Usage:
         r.mapcalc [expression=string] [file=name] [--overwrite] [--verbose]
           [--quiet]

The above example is shorthand for:

        r.mapcalc expression="outmap = whatever"

For this to work, the expression must be a single argument (i.e. 
quoted), and there must be a space between the output map and the
first "=". Using:

        r.mapcalc "outmap=whatever"

would result in G_parser() complaining that "outmap" isn't a
recognised option name.

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to