Hi,<div><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 3:18 PM, Markus Metz <span dir="ltr"><<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Jan 23, 2013 at 1:21 PM, Helmut Kudrnovsky <<a href="mailto:hellik@web.de">hellik@web.de</a>> wrote:<br>
>> but when I launch r.basin in a closing section of the basin, I get the<br>
> error: "map of accumulations<br>
>> does not match the map of elevations."<br>
><br>
> r.basin is based upon r.stream.extract and other useful modules.<br>
<br>
</div>The bug is in r.basin which modifies the current region after<br>
r.watershed is called and before r.stream.extract is called, if the<br>
default threshold should be used. In this case, the region is set to<br>
match the input elevation map in order to get the resolution (nsres<br>
only by the way). The fix would be to replace in <a href="http://r.basin.py" target="_blank">r.basin.py</a> line 135 -<br>
137<br>
info_region = grass.read_command('g.region', flags = 'p', rast<br>
= '%s' % (r_elevation))<br>
dict_region = grass.parse_key_val(info_region, ':')<br>
resolution = float(dict_region['nsres'])<br>
with<br>
resolution = grass.region()['nsres']<br></blockquote><div><br></div><div> FYI, I applied this modification, and also switched from SFD to MFD algorithm in r.basin. I also updated the wiki page documentation accordingly.</div>
<div><br></div><div>Regards,</div><div>madi</div><div><br></div><div><br></div></div>-- <br><div><div><font color="#666666">Margherita DI LEO </font></div><div><font color="#666666">Postdoctoral Researcher</font></div>
<div><font color="#666666"><br></font></div><div><font color="#666666">European Commission - DG JRC </font></div><div><font color="#666666">Institute for Environment and Sustainability (IES). Unit H03 – FRC</font></div><div>
<font color="#666666">Via Fermi, 2749</font></div><div><font color="#666666">I-21027 Ispra (VA) - Italy - TP 261</font></div><div><font color="#666666"> </font></div><div><font color="#666666">Tel. +39 0332 78 3600 </font></div>
<div><font color="#666666"><a href="mailto:margherita.di-leo@jrc.ec.europa.eu" target="_blank">margherita.di-leo@jrc.ec.europa.eu</a></font></div><div><font color="#666666"><br></font></div><div><font color="#666666">Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.</font></div>
</div>
</div>