[GRASS-dev] pygrass.gis.Region API explanations

Panagiotis Mavrogiorgos pmav99 at gmail.com
Sun Apr 28 23:16:09 PDT 2019


On Sat, Apr 27, 2019 at 7:13 PM Markus Neteler <neteler at osgeo.org> wrote:

> Here is some sample code:
>
> https://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library#Using_temporary_region_for_computations
>
> which makes use of script.core.use_temp_region()
>
> https://grass.osgeo.org/grass77/manuals/libpython/script.html#script.core.use_temp_region
>
>
Thank you Markus,

The "problem" is that "use_temp_region()" is calling "g.region" and I would
like to avoid that if possible, since it entails some overhead vs using the
API.

> The following methods seem to be relevant:
>
> Region.set_current()
> Region.set_raster_region()
> Region.write()

As far as I can understand this, the only method that will actually change
the computational region is "write()" am I correct?

Could also someone clarify what is the difference between "working region"
mentioned in "set_current()" and the computational region?

all the best,
Panos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20190429/bcef56ec/attachment.html>


More information about the grass-dev mailing list