[GRASS-user] Re: mapcalc problem in python script!!
josh at snorfalorpagus.net
Thu Feb 3 11:26:47 EST 2011
Looking at your Python code and the error, I expect the issue is with the way you are calling the script, rather than it's content.
From the documentation, g.parser returns a Python dictionary. The options "command" is a variable, rather than a function.
The key error occurs when you attempt to access a key, in your case upstream_shreve, when it does not exist.
I suspect the problem is that you're not setting a value for upstream_shreve from the command line, i.e.,
./test3.py upstream_shreve=newmapname upstream_part=upstreammap shreve=anothermap
In your Python script, if you throw in:
You'll be able to quickly check it contains the key-value pairs you expect.
Hope this helps,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user