<div dir="ltr">Thank you Luca,<div><br></div><div>the problem was that in the options settings the parameter gisprompt for</div><div>the output did not contain "new". After changing the line to gispromt: new,</div>
<div>the overwrite option was available.</div><div>Thank you for the tip with the <span class="" style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px;color:rgb(0,0,0)">"grass.overwrite()" which returns TRUE if</span></div>
<div><span class="" style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px;color:rgb(0,0,0)">overwrite is set.</span></div><div><span class="" style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px;color:rgb(0,0,0)"><br>
</span></div><div><span class="" style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px;color:rgb(0,0,0)">/Johannes</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 11:17 PM, Luca Delucchi <span dir="ltr"><<a href="mailto:lucadeluge@gmail.com" target="_blank">lucadeluge@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 30 September 2013 17:10, Johannes Radinger<br>
<<a href="mailto:johannesradinger@gmail.com">johannesradinger@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
<br>
Hi<br>
<div><div class="h5"><br>
> when I tried to write a python script (add-on) for GRASS GIS I experienced<br>
> that there is no overwrite-flag by default in the GUI for that module<br>
> (generate by<br>
> g.parser) which is different from GRASS6x. So is there any possibility to<br>
> create<br>
> that tick-box also in G70?<br>
> Furthermore I am using the grass.script.array to write a raster map from<br>
> a numpy.array:<br>
><br>
> my_map = garray.array()<br>
> my_map[...] = my_function_mod(input_raster)<br>
> my_map.write(options['my_output'])<br>
><br>
> But what if the output ("my_output") already exists and I want to overwrite<br>
> that output (e.g. by setting the modules overwrite flag)?<br>
><br>
<br>
</div></div>overwrite flag should be in the parser, you have to check if overwrite<br>
is active and if your map already exits.<br>
You can check if the overwrite is active with "grass.overwrite()"<br>
<div class="HOEnZb"><div class="h5"><br>
> Any suggestions are welcome, thanks!<br>
><br>
> cheers,<br>
> /Johannes<br>
><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
ciao<br>
Luca<br>
<br>
<a href="http://gis.cri.fmach.it/delucchi/" target="_blank">http://gis.cri.fmach.it/delucchi/</a><br>
<a href="http://www.lucadelu.org" target="_blank">www.lucadelu.org</a><br>
</font></span></blockquote></div><br></div>