[GRASS-dev] strange mapcalc result

Michael Barton michael.barton at asu.edu
Mon Jul 18 12:51:28 EDT 2011



On Jul 18, 2011, at 9:00 AM, grass-dev-request at lists.osgeo.org wrote:

> Helena:
> that r.mapcalc is now a normal module using G_parser() and so requires
> special care with '=' (as described by Markus) should definitely be
> mentioned in any changes from grass6 list. fwiw over the last year I've
> slowly been going around updating all grass6 scripts and help examples
> I've come across to add the spaces to make them forward compatible.
> 
> pthreads doesn't parse, it breaks up the processing into multiple threads
> internally for a performance gain.
> 
> 
> Hamish



On the Mac at least, it does not matter whether or not there are spaces around the "=".

For example...

GRASS 7.0.svn (spearfish60_test):~ > g.copy rast='elevation_dem,mapcalc_test'
Copy raster <elevation_dem at PERMANENT> to current mapset as <mapcalc_test>

this one has no spaces...

GRASS 7.0.svn (spearfish60_test):~ > r.mapcalc expression='mapcalc_test2=mapcalc_test+1'
 100%

this one has spaces...

GRASS 7.0.svn (spearfish60_test):~ > r.mapcalc expression='mapcalc_test3 = mapcalc_test+1' 
 100%

both work and there is no difference between the results...

GRASS 7.0.svn (spearfish60_test):~ > r.mapcalc expression='mapcalc_diff=mapcalc_test2-mapcalc_test3'
 100%
GRASS 7.0.svn (spearfish60_test):~ > r.info mapcalc_diff -r
min=0
max=0



MIchael
______________________________
C. Michael Barton 
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 	480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax:          480-965-7671(SHESC), 480-727-0709 (CSDC)
www: 	http://csdc.asu.edu, http://shesc.asu.edu
		http://www.public.asu.edu/~cmbarton


More information about the grass-dev mailing list