<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 5:05 AM, Pietro <span dir="ltr"><<a href="mailto:peter.zamb@gmail.com" target="_blank">peter.zamb@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="">On Fri, Jul 25, 2014 at 10:39 AM, Martin Zbinden<br>
<<a href="mailto:martin.zbinden@gmail.com">martin.zbinden@gmail.com</a>> wrote:<br>
> If I understand correctly, Region.set_current() can be used<br>
> to effectively change the region currently used by GRASS. But changing<br>
> extent of Raster()-object and executing set_current() does not have<br>
> any effect.<br>
<br>
</div>I found the same thing some months ago:<br>
<br>
<a href="https://lists.osgeo.org/pipermail/grass-dev/2014-February/067543.html" target="_blank">https://lists.osgeo.org/pipermail/grass-dev/2014-February/067543.html</a><br>
<br>
as explained by Vaclav:<br>
<br>
"If you change region in C or using ctypes in Python, it is affecting<br>
only the current process."</blockquote></div><br></div><div class="gmail_extra">And on the hand, if you change region using g.region, only region for subprocesses is changed but library functions are not affected. So, g.region will affect pygrass.modules.Module but not pygrass.raster, pygrass.vector and others.<br>

<br></div><div class="gmail_extra">I was actually the one saying that pygrass Region should use library functions, not g.region, to be part of C library wrapper together with other pygrass functions. However, pygrass.modules needs their own mechanism, perhaps simple Module('g.region', ...) is the most appropriate.<br>

<br></div><div class="gmail_extra">One could suggest to have Region calling both g.region and library functions but this could significantly decrease speed due to invocation of subprocesses especially when Region API is in style region.set_north(), region.set_south(). Maybe as a opt-in feature (set in constructor) but I'm not 100% sure about that.<br>

<br></div><div class="gmail_extra">Vaclav<br></div></div>