[GRASS-user] problem with python scripting

Leonardo Hardtke leohardtke at gmail.com
Mon Apr 4 23:53:32 PDT 2016


Dear users,
I am writing a script and I'm having problems with the flags for mapcalc
gscript.mapcalc('endmember_rstr.1 = null()', flags="o")

ERROR: output map <endmember_rstr.1> exists. To overwrite, use the
       --overwrite flag
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/grass70/etc/python/grass/script/raster.py", line 103, in
mapcalc
    quiet=quiet, verbose=verbose, overwrite=overwrite)
  File "/usr/lib/grass70/etc/python/grass/script/core.py", line 516, in
write_command
    return handle_errors(returncode, returncode, args, kwargs)
  File "/usr/lib/grass70/etc/python/grass/script/core.py", line 312, in
handle_errors
    returncode=returncode)
  File "/usr/lib/grass70/etc/python/grass/exceptions/__init__.py", line 68,
in __init__
    msg = _("Module run %s %s ended with error") % (module, code)
TypeError: 'str' object is not callable

with other modules flags are working as I expect, like....

gscript.run_command("g.region", flags="p")
projection: 1 (UTM)
zone:       -20
datum:      wgs84
ellipsoid:  wgs84
north:      5326556.02809
south:      5228355.32592
west:       290546.512535
east:       444008.446334
nsres:      30.00326984
ewres:      30.0081998
rows:       3273
cols:       5114
cells:      16738122

Am I missing something?

Thanks!
-- 
Dr. Leonardo A. Hardtke
Laboratorio de Teledetección y S.I.G.
Centro Nacional Patagónico (CONICET)
Bvd. Brown 2825, 9120
Puerto Madryn, Chubut, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160405/faa1aefb/attachment.html>


More information about the grass-user mailing list