[Qgis-user] Adding grass commands to the processing toolbox

Olivier Dalang olivier.dalang at gmail.com
Wed Apr 1 04:05:53 PDT 2015


Dear list,

How can I use a GRASS function from within QGIS if it's not in the toolbox ?

Ideally, I'd like a GUI solution. But actually I wasn't even able to find
how to use it in command line (I don't know anything of grass, only used it
through the processing toolbox for now).

I'm trying to use this function:
v.net.centrality -a input=streets at anita_000 output=centrality degree=degree
closeness=closeness betweenness=betweenness eigenvector=eigenvector
(found here: http://planet.qgis.org/planet/tag/gis%20analysis/ , thanks
Anita)

This is how far I got:

.qgis2\processing\scripts\betweennessCentrality.py


> ##network=vector
> ##output=output vector
> import grass.script as grass
> grass.run_command("v.net.centrality", flags='a', input=network,
> output=output, degree='degree', closeness='closeness',
> betweenness='betweenness', eigenvector='eigenvector')


But I get an error when I run the algorithm (the gui loads nicely):
No module named grass.script See log for more details


Any help would be greatly appreciated !

Best,

Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150401/d1ef096e/attachment.html>


More information about the Qgis-user mailing list