<div dir="ltr"><div><div><div><br><br>On Fri, Dec 15, 2017 at 5:50 PM, Luca Delucchi <<a href="mailto:lucadeluge@gmail.com">lucadeluge@gmail.com</a>> wrote:<br>><br>> Hi Nagy, <br>><br>> Il 15 dic 2017 5:42 PM, "Nagy Edmond" <<a href="mailto:nagy.edmond.eno@gmail.com">nagy.edmond.eno@gmail.com</a>> ha scritto:<br>><br>> Markus, thank you very much for helping.<br>><br>> I have now included into the add-on directory the py, html and makefile<br>> files. The last one is an example I found somewhere, but I am not sure how<br>><br>><br>> You can have a look to makefile for addons in the svn repository [1] <br>><br>> to adapt it, or how to run it (or from where) to generate the final html.<br>> Could you please tell me how it works, or point me to a working example?<br>><br>><br>> To understand how it works you can read the docs in the wiki about addons compilation [0]<br>> I hope this is helpful <br><br></div>The Makefile must have this content:<br>--><br>MODULE_TOPDIR = ../..<br><br>PGM = v.lcp.network<br><br>include $(MODULE_TOPDIR)/include/Make/Script.make<br><br>default: script<br><--<br><br></div>then run make in the folder v.lcp.network. You might need to set MODULE_TOPDIR with something like<br><br></div>export MODULE_TOPDIR=/path/to/grass-source make<br><div><div><div><br></div><div><br></div><div>Some comments on the module:</div><div><br></div><div>You don't need both the -v and the -w flag, they are mutually exclusive. E.g. only the -w flag is enough:</div><div>-w flag not set: use r.cost</div><div>-w flag set: use r.walk</div><div><br></div><div>How to get the number of points in a vector:</div><div>pointnb = grass.vector_info_topo(map=vInput)['points']</div><div><br></div><div>You could eliminate the inner for loop at L180, this would vastly speed up the module:</div><div>r.cost, r.walk, and r.drain accept multiple points as input, therefore you could use all points but the current point as stop points for r.cost/r.walk and as start points for r.drain</div><div><br></div><div>HTH,</div><div><br></div><div>Markus M</div><div><br></div><div>><br>><br>> Edmond<br>><br>><br>> Ciao <br>> Luca <br>><br>><br>> [0] <a href="https://grasswiki.osgeo.org/wiki/Compile_and_Install#Addons">https://grasswiki.osgeo.org/wiki/Compile_and_Install#Addons</a><br>> [1] <a href="https://trac.osgeo.org/grass/browser/grass-addons/grass7">https://trac.osgeo.org/grass/browser/grass-addons/grass7</a> <br>><br>> _______________________________________________<br>> grass-psc mailing list<br>> <a href="mailto:grass-psc@lists.osgeo.org">grass-psc@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-psc">https://lists.osgeo.org/mailman/listinfo/grass-psc</a><br><br></div></div></div></div>