[GRASS-user] mapcalc problem in python script!!
Johannes Radinger
JRadinger at gmx.at
Mon Feb 7 07:58:37 EST 2011
Hey,
-------- Original-Nachricht --------
> Datum: Fri, 4 Feb 2011 00:10:16 +0000
> Von: Glynn Clements <glynn at gclements.plus.com>
> An: grass-user at lists.osgeo.org
> Betreff: Re: [GRASS-user] mapcalc problem in python script!!
>
> 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).
I don't know which feature to disable?!? And I don't know why gmx is bouncing your emails...strange somehow...
>
> > 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).
I added your comments "#%" in the script (see attachment). Is it the only way to run the grass.mapcalc version in python with the grass.parser? I run my script external, directly from IDLE (without starting grass).
Has anyone wrote a python script for GRASS-Windows combination which is calling the mapcalculator and is totally outside of grass?
Just see my attached script.
cheers
johannes
>
> --
> Glynn Clements <glynn at gclements.plus.com>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
--
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test3.py
Type: text/x-python-script
Size: 1518 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20110207/21a4aa16/test3.bin
More information about the grass-user
mailing list