Friday 25 March 2016

qgis - Calling GRASS modules in pyQGIS?


I wish to use a Grass module (v.to.db) in QGis, without the grass toolbox.


I tried with the Python console, but to no avail :



  • Using Sextante plugin but obviously it didn't know all the grass modules.




from sextante.core.Sextante import Sextante


Sextante.alghelp("grass:v.to.db")


--> Algorithm not found




  • An other test :




grass.run_command("v.to.db", map='bl@PERMANENT', layer='2', option='start', units='meters', columns='X,Y,Z')


-->Traceback (most recent call last):


File "", line 1, in module


NameError: name 'grass' is not defined



Do you know if there is an other way to use the grass module ? I don't want to use it in the grass toolbox because I can select only one colums in "attribute field", and I would like to choose several columns.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...