[GRASS-windows] Fwd: Re: mapcalc/mapcalculator in python script

Johannes Radinger JRadinger at gmx.at
Thu Feb 3 11:19:23 EST 2011


Hello,

I posted the same problem already at the GRASS-user list, but
I think here is the better platform:

my Problem is that I run WinGRASS 6.5SVN and want to use
the grass.mapcalc function in python but it doesn't work.

I am running excactly:
> grass.mapcalc("$upstream_shreve = if(${upstream_part},${shreve})",
>                   upstream_shreve = options['upstream_shreve'],
>                   upstream_part = options['upstream_part'],
>                   shreve = options['shreve'])

and according to users this code should work but it doesn't. I get following answer from the python shell:

Traceback (most recent call last):
  File "C:\Users\XY\Documents\Pyhton Scripts\test3.py", line 40, in <module>
    sys.exit(main())
  File "C:\Users\XY\Documents\Pyhton Scripts\test3.py", line 32, in main
    upstream_shreve = options['upstream_shreve'],
KeyError: 'upstream_shreve'

does anyone know what the problem is? It is assumed that it is a bug...
all other grass.run_commands are working...it's just the mapcalculator...

I'm somehow bound to 6.5 as there is also the r.stream.* module integrated in the install-package.

thank you
cheers
johannes

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl


More information about the grass-windows mailing list