[GRASS-dev] formatting expressions for r.mapcalc in GRASS6.4.3

Helena Mitasova hmitaso at ncsu.edu
Thu Jan 31 19:16:49 PST 2013


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?

If yes, should we include something like this in the manual? 

For example, the ndvi example in the manual would not run from the command console on MSwindows
and the text talking about running r.mapcalc non-interactively and interactively, refers to the old way
of running GRASS before there was any GUI. 
The Note about running r.mapcalc on command line can also cause some confusion - this is how that example works in the shell

GRASS 6.4.3RC2 (nc_spm_08):~ > r.mapcalc result = 'elevation * 2'
 100%
GRASS 6.4.3RC2 (nc_spm_08):~ > r.mapcalc result=elevation*2
 100%
GRASS 6.4.3RC2 (nc_spm_08):~ > r.mapcalc
Enter expressions, "end" when done.
mapcalc> result = 'elevation * 2'
Illegal filename. Character < > not allowed.
Invalid map <elevation * 2>
mapcalc> result=elevation*2
mapcalc> end
100%

GRASS7 is a different story, but examples in the manual for grass7 may need testing and revision too.

Helena


Helena Mitasova
Associate Professor
Department of Marine, Earth, and Atmospheric Sciences
2800 Faucette Drive, Rm. 1125 Jordan Hall
North Carolina State University
Raleigh, NC 27695-8208
hmitaso at ncsu.edu

"All electronic mail messages in connection with State business which are sent to or received by this account are subject to the NC Public Records Law and may be disclosed to third parties.” 



More information about the grass-dev mailing list