[GRASSLIST:4027] GRASS4.3 mapcalc

Alex Thorn amthorn1979 at yahoo.com
Thu Jul 4 16:37:26 EDT 2002


I'm guessing that this is a known bug, but don't know
whether it is unique to GRASS4.3, or whether there are
good ways of working around it.  Any suggestions would
be appreciated.

I've been experimenting a bit with scripting, and have
encountered the following problem regarding mapcalc:
it seems that while typing a single line command works
fine when using mapcalc for addition or subtraction,
e.g.:

GRASS:~/grassscripts > r.mapcalc rice2fieldsc.0 =
rice2label.0 - fields2

EXECUTING rice2fieldsc.0 = ...  100%
CREATING SUPPORT FILES FOR rice2fieldsc.0
minimum value 0, maximum value 1

...it won't behave as nicely when I try to do map
multiplication:

GRASS:~/grassscripts > r.mapcalc randfood = fields2 *
randrast2
you have confused me


Instead, I've had to first type r.mapcalc, and then
type in the equation at the mapcalc prompt:

GRASS:~/grassscripts > r.mapcalc

mapcalc> randfood = fields2 * randrast2

EXECUTING randfood = ...  100%
CREATING SUPPORT FILES FOR randfood
minimum value 0, maximum value 2


When I'm working interactively, this is fine, but I
don't know of a way to make it work in the context of
a script.  Should I just avoid using mapcalc
multiplication in scripts?  Would switching to
GRASS5.0 help?  Or is there some way of bypassing this
issue that I don't know about?  I'm still new to GRASS
and scripting, so figured that it would not hurt to
ask.

Thanks,
Alex

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



More information about the grass-user mailing list