DJANGO
Sets up a grass environment in the current running process. Allows grass commands
to be run in a shell environment. Optimally grass python bindings would be used in the
future once they become more stable and full-featured
Grass is not thread-safe, see http://grass.osgeo.org/wiki/Parallel_GRASS_jobs
Because of this there can be issues with race conditions while working within
the same mapset with more than one process. The solution is to create a new
mapset for each analysis run, copy the necessary maps into the new mapset,
run the analysis, and then remove the mapset when you're done.
@author: Tim Welch, Ecotrust 2009
@author: Matthew Perry, Ecotrust 2011
Concepts taken from the PyWPS project.
Example usage (django):
g = Grass('mlpa_sc')
result = g.run('r.info soilmoisture')
# Django Settings:
# GRASS_GISBASE = '/usr/local/grass-6.4.1RC2'
# GRASS_GISDBASE = '/home/grass'
Example usage (outside django):
g = Grass('mlpa_sc', gisdbase="/home/grass", gisbase="/usr/local/grass-6.4.1RC2")
result = g.run('r.info soilmoisture')
- Value:
-
|