<div dir="ltr">Hi again !<div><br></div><div>I'm crossposting to qgis-dev since it's becoming more of a dev question...</div><div><br></div><div>I found a way to make it work on QGIS 2.8 64 bits (windows).</div><div><br></div><div>I've added this file  <font face="monospace, monospace" style="background-color:rgb(204,204,204)"><span style="font-size:12.8000001907349px">OSGeo4W64\apps\qgis\python\</span><span style="font-size:12.8000001907349px">plugins\processing\algs\grass\</span><span style="font-size:12.8000001907349px">description</span>\v.net.centrality.txt</font>  with this content :</div><div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">v.net.centrality</font></span></div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">v.net.centrality - Toolset for computing centralities</font></span></div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">Vector (v.*)</font></span></div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">ParameterVector|input|Neworklayer|-1|False</font></span></div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">ParameterString|betweenness|Betweenness field name|betweenness</font></span></div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">ParameterBoolean|-a|-a|True</font></span></div><div><span style="background-color:rgb(204,204,204)"><font face="monospace, monospace">OutputVector|output|Output</font></span></div></div><div><br></div><div>And now I've the function right in QGIS's toolbox, and it works perfectly !</div><div><br></div><div>However, this doesn't seem to work on Mac (I put the file in the corresponding folder of QGIS.app, but the tool doesn't appear in the processing toolbox), any idea why ?<br></div><div>Or is it globally not the way to go (it seems a bit dirty to extend the toolbox by creating new files in the application folder) ?</div><div><br></div><div>Best,</div><div><br></div><div>Olivier</div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-01 13:05 GMT+02:00 Olivier Dalang <span dir="ltr"><<a href="mailto:olivier.dalang@gmail.com" target="_blank">olivier.dalang@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear list,<div><br></div><div>How can I use a GRASS function from within QGIS if it's not in the toolbox ?</div><div><br></div><div>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).<br></div><div><br></div><div>I'm trying to use this function:</div><div><span style="color:rgb(221,17,68);font-family:'Andale Mono','Ubuntu Mono','Courier New',Courier,monospace;font-size:12px;line-height:19.2000007629395px;white-space:nowrap;background-color:rgb(247,247,249)">v.net.centrality -a input=streets@anita_000 output=centrality degree=degree closeness=closeness betweenness=betweenness eigenvector=eigenvector</span><br></div><div>(found here: <a href="http://planet.qgis.org/planet/tag/gis%20analysis/" target="_blank">http://planet.qgis.org/planet/tag/gis%20analysis/</a> , thanks Anita)</div><div><br></div><div>This is how far I got:</div><div><br></div><font face="monospace, monospace">.qgis2\processing\scripts\betweennessCentrality.py</font><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace"></font><font face="monospace, monospace">##network=vector<br></font><font face="monospace, monospace">##output=output vector<br></font><font face="monospace, monospace">import grass.script as grass<br></font><font face="monospace, monospace">grass.run_command("v.net.centrality", flags='a', input=network, output=output, degree='degree', closeness='closeness', betweenness='betweenness', eigenvector='eigenvector')</font></blockquote><div><br></div><div>But I get an error when I run the algorithm (the gui loads nicely):</div><div><span style="color:rgb(255,0,0)">No module named grass.script See log for more details</span></div><div><div><br></div><div><br></div><div>Any help would be greatly appreciated !</div><div><br></div><div>Best,</div><div><br></div><div>Olivier</div><div><br></div></div></div>
</blockquote></div><br></div></div>