[GRASS-user] mapcalc problem in python script!!

Glynn Clements glynn at gclements.plus.com
Thu Feb 3 19:10:16 EST 2011


Johannes Radinger wrote:

> Somehow I didn't your answer via email, I just found it at
> http://permalink.gmane.org/gmane.comp.gis.grass.user/38530

For whatever reason, GMX doesn't like my IP address, and bounces my
emails. The problem is compounded by a "feature" of the mailing list
software which (by default) doesn't send messages to any subscriber
whose email address appears in the To or CC fields (on the assumption
that they'll already get a copy). You can (and probably should)
disable this feature in your preferences (via the link at the bottom
of the email).

> just to give you some more information on my problem:
> I am running exactly following script:

> def main():
>     grass.mapcalc("$upstream_shreve = ${upstream_part}+${shreve}",
>                   upstream_shreve = options['upstream_shreve'],
>                   upstream_part = options['upstream_part'],
>                   shreve = options['shreve'])
>     return 0
> 
> if __name__ == "__main__":
>     options, flags = grass.parser()

grass.parser() needs to know the valid options for the script. These
are specified by comments beginning with "#%". See any existing script
for reference.

Then, you need to run the script with the appropriate command line
options. I'm assuming that isn't happening, because you should get an
error if you provide an unrecognised option (and there are no
recognised options).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list