[Qgis-user] call grass modules via qgis python console

richard burcher drownedfrog at gmail.com
Fri Aug 10 09:26:06 PDT 2012


Hi maning,

Take a look at Sextante plugin. Can call grass modules from python console
very easily.

example:
#import sextante python bindings
from sextante.core.Sextante import Sextante

#search avaible modules -- all
Sextante.alglist()
#search specific 
Sextante.alglist("voronoi")
[output] v.voronoi - Creates a Voronoi diagram from an input vector map
containing points or centroids.--->grass:v.voronoi

#get help on alg inputs
Sextante.alghelp("grass:v.voronoi")
[output] ALGORITHM: v.voronoi - Creates a Voronoi diagram from an input
vector map containing points or centroids.
        input <ParameterVector>
        -l <ParameterBoolean>
        -t <ParameterBoolean>
        GRASS_REGION_PARAMETER <ParameterExtent>
        GRASS_REGION_CELLSIZE_PARAMETER <ParameterNumber>
        output <OutputVector>

#run algorithm
Sextante.runalg("grass:v.voronoi",[follow from Sextante.alghelp output])

Use the svn update of Sextante. Checkout my blog post on setting up svn for
this
http://geotechrichard.com/2012/06/08/how-to-keep-pace-with-qgis-sextante-svn-of-course/

Cheers,

Richard




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/call-grass-modules-via-qgis-python-console-tp4994410p4994471.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list