<div dir="ltr">Thanks Paulo and Sören for helping!<div>overwrite=True made the trick! Is this documented somewhere and I just missed it??? Or should I fill a ticket?</div><div><br></div><div>Leo</div><div><br></div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-05 17:06 GMT+10:00 Sören Gebbert <span dir="ltr"><<a href="mailto:soerengebbert@googlemail.com" target="_blank">soerengebbert@googlemail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Please try gscript.mapcalc(expr... , overwrite=True)</p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">Am 05.04.2016 09:02 schrieb "Leonardo Hardtke" <<a href="mailto:leohardtke@gmail.com" target="_blank">leohardtke@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Paulo and thanks for the answer... but It gives me a very similar error if I write the full flag.... (The only difference is TypeError... str if I use 'o' and int if I use 'overwrite'.... )<div><br><div><div><font face="monospace, monospace"> gscript.mapcalc('endmember_rstr.1 = null()', flags="overwrite")</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">ERROR: output map <endmember_rstr.1> exists. To overwrite, use the</font></div><div><font face="monospace, monospace">       --overwrite flag</font></div><div><font face="monospace, monospace">Traceback (most recent call last):</font></div><div><font face="monospace, monospace">  File "<stdin>", line 1, in <module></font></div><div><font face="monospace, monospace">  File "/usr/lib/grass70/etc/python/grass/script/raster.py", line 103, in mapcalc</font></div><div><font face="monospace, monospace">    quiet=quiet, verbose=verbose, overwrite=overwrite)</font></div><div><font face="monospace, monospace">  File "/usr/lib/grass70/etc/python/grass/script/core.py", line 516, in write_command</font></div><div><font face="monospace, monospace">    return handle_errors(returncode, returncode, args, kwargs)</font></div><div><font face="monospace, monospace">  File "/usr/lib/grass70/etc/python/grass/script/core.py", line 312, in handle_errors</font></div><div><font face="monospace, monospace">    returncode=returncode)</font></div><div><font face="monospace, monospace">  File "/usr/lib/grass70/etc/python/grass/exceptions/__init__.py", line 68, in __init__</font></div><div><font face="monospace, monospace">    msg = _("Module run %s %s ended with error") % (module, code)</font></div><div><font face="monospace, monospace">TypeError: 'int' object is not callable</font></div></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Thanks for your help!</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-05 16:56 GMT+10:00 Paulo van Breugel <span dir="ltr"><<a href="mailto:p.vanbreugel@gmail.com" target="_blank">p.vanbreugel@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span>
    <br>
    <br>
    <div>On 05-04-16 08:53, Leonardo Hardtke
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Dear users,
        <div>I am writing a script and I'm having problems with the
          flags for mapcalc<br>
          <div>
            <div><font face="monospace, monospace">gscript.mapcalc('endmember_rstr.1
                = null()', flags="o")</font></div>
          </div>
        </div>
      </div>
    </blockquote>
    <br></span>
    If  you are using GRASS 7.+, the overwrite flag should be written in
    full, i.e., <br>
    <br>
    <pre>gscript.mapcalc('endmember_rstr.1 = null()', flags="overwrite")</pre>
    <br>
    <blockquote type="cite"><div><div>
      <div dir="ltr">
        <div>
          <div>
            <div><font face="monospace, monospace"><br>
              </font></div>
            <div><font face="monospace, monospace">ERROR: output map
                <endmember_rstr.1> exists. To overwrite, use the</font></div>
            <div><font face="monospace, monospace">       --overwrite
                flag</font></div>
            <div><font face="monospace, monospace">Traceback (most
                recent call last):</font></div>
            <div><font face="monospace, monospace">  File
                "<stdin>", line 1, in <module></font></div>
            <div><font face="monospace, monospace">  File
                "/usr/lib/grass70/etc/python/grass/script/raster.py",
                line 103, in mapcalc</font></div>
            <div><font face="monospace, monospace">    quiet=quiet,
                verbose=verbose, overwrite=overwrite)</font></div>
            <div><font face="monospace, monospace">  File
                "/usr/lib/grass70/etc/python/grass/script/core.py", line
                516, in write_command</font></div>
            <div><font face="monospace, monospace">    return
                handle_errors(returncode, returncode, args, kwargs)</font></div>
            <div><font face="monospace, monospace">  File
                "/usr/lib/grass70/etc/python/grass/script/core.py", line
                312, in handle_errors</font></div>
            <div><font face="monospace, monospace">   
                returncode=returncode)</font></div>
            <div><font face="monospace, monospace">  File
                "/usr/lib/grass70/etc/python/grass/exceptions/__init__.py",
                line 68, in __init__</font></div>
            <div><font face="monospace, monospace">    msg = _("Module
                run %s %s ended with error") % (module, code)</font></div>
            <div><font face="monospace, monospace">TypeError: 'str'
                object is not callable</font></div>
            <div><br>
            </div>
            <div>with other modules flags are working as I expect,
              like....</div>
            <div><br>
            </div>
            <div>
              <div><font face="monospace, monospace">gscript.run_command("g.region",
                  flags="p")</font></div>
              <div><font face="monospace, monospace">projection: 1 (UTM)</font></div>
              <div><font face="monospace, monospace">zone:       -20</font></div>
              <div><font face="monospace, monospace">datum:      wgs84</font></div>
              <div><font face="monospace, monospace">ellipsoid:  wgs84</font></div>
              <div><font face="monospace, monospace">north:    
                   5326556.02809</font></div>
              <div><font face="monospace, monospace">south:    
                   5228355.32592</font></div>
              <div><font face="monospace, monospace">west:      
                  290546.512535</font></div>
              <div><font face="monospace, monospace">east:      
                  444008.446334</font></div>
              <div><font face="monospace, monospace">nsres:    
                   30.00326984</font></div>
              <div><font face="monospace, monospace">ewres:    
                   30.0081998</font></div>
              <div><font face="monospace, monospace">rows:       3273</font></div>
              <div><font face="monospace, monospace">cols:       5114</font></div>
              <div><font face="monospace, monospace">cells:    
                   16738122</font></div>
            </div>
            <div><br>
            </div>
            <div>Am I missing something?</div>
            <div><br>
            </div>
            <div>Thanks!</div>
            -- <br>
            <div>
              <div dir="ltr">Dr. Leonardo A. Hardtke   <br>
                Laboratorio de Teledetección y S.I.G.  <br>
                Centro Nacional Patagónico (CONICET) <br>
                Bvd. Brown 2825, 9120 <br>
                Puerto Madryn, Chubut, Argentina </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
grass-user mailing list
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a></pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Dr. Leonardo A. Hardtke   <br>Laboratorio de Teledetección y S.I.G.  <br>Centro Nacional Patagónico (CONICET) <br>Bvd. Brown 2825, 9120 <br>Puerto Madryn, Chubut, Argentina </div></div>
</div>
<br>_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Dr. Leonardo A. Hardtke   <br>Laboratorio de Teledetección y S.I.G.  <br>Centro Nacional Patagónico (CONICET) <br>Bvd. Brown 2825, 9120 <br>Puerto Madryn, Chubut, Argentina </div></div>
</div>