Saturday, 9 September 2017

How to call processing toolbox in Qgis' python console


I have been trying to use processing toolbox via python console in Qgis 2.0.1. I am able to write the following comamnds:


enter image description here


I am particularly interested to run 'r.statistics' from GRASS module.



enter image description here


My question is how to arrange the input parameters sequentially and what dfoes each parameter mean? For example, in the above screenshot, when I type the help, I can see the parameter inputs,


processing.runalg('grass:r.statistics', base, cover, method, -c, GRASS region parameter, Grass region cell size, output)


I can understand that 'base = input raster', 'method = avg, mean, std' and 'output=outputfile to eb declared'.


But I am not sure what are 'cover=', '-c','GRASS region means'? How can I get further help on that? if I were to run the function 'r.statistics' via processing toolbox,how should the exact/correct command look like?


processing.runalg('grass:r.statistics', 'C:\mydata\dem.tif', cover, '1', -c, GRASS region parameter, Grass region cell size, 'C:\mydata\outputdem.tif')


Can anyone help me what to put in place of rest of the parameters?


Thanks in advance.




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...