[GRASS-dev] creating temporary mapsets in a parallelized python script

Anna Petrášová kratochanna at gmail.com
Mon Apr 11 13:44:05 PDT 2016


On Mon, Apr 11, 2016 at 4:04 PM, Helmut Kudrnovsky <hellik at web.de> wrote:
> Hi,
>
> in a parallelized python script it is needed to do the parallelized jobs in
> different mapsets as region settings are changed during calculations.

are you sure you need separate mapsets? You can also just use this:

env = os.environ.copy()
env['GRASS_REGION'] = grass.region_env(raster='elevation')

gscript.run_command('r.viewshed', ..., env=env)

Anna

>
> Any hints how to create temporary mapsets? Already existing pygrass /
> pyscript functions?
>
> thanks
>
>
>
> -----
> best regards
> Helmut
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/creating-temporary-mapsets-in-a-parallelized-python-script-tp5260753.html
> Sent from the Grass - Dev mailing list archive at Nabble.com.
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list