<div dir="ltr"><div><div><div><br><br>On Sat, Dec 16, 2017 at 7:41 PM, Edmond Nagy <<a href="mailto:nagy.edmond.eno@gmail.com">nagy.edmond.eno@gmail.com</a>> wrote:<br>><br>> Hi Markus,<br>><br>> Thank you for your patience and your feedback.<br>><br>> First of all, I would like to ask a couple more questions about the make file.<br>> The MODULE_TOPDIR from the Makefile should be (as its name says) the full path to the "v.lcp.network" directory, where all three files are, the py script, the html and the Makefile? After that, should I save the Makefile as Makefile.exe and run it by clicking it? I would also like to know if it matters where the "v.lcp.network" directory is when I run the Makefile, or should it be in a more specific location.<br><br></div>The Makefile must be exactly<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>You use the Makefile indirectly by running make in the directory v.lcp.network. It does not matter where the "v.lcp.network" directory is. You can override MODULE_TOPDIR with<br>export MODULE_TOPDIR=/path/to/grass-<wbr>source make<br><br></div>MODULE_TOPDIR is the path to the main GRASS source folder<br><div><div><br></div><div>I understand you are using Microsoft Windows. You might need to compile GRASS from source in order to test your module, please read</div><div><br></div><div><a href="https://trac.osgeo.org/grass/wiki/CompileOnWindows">https://trac.osgeo.org/grass/wiki/CompileOnWindows</a><br></div><div><br></div><div>HTH,</div><div><br></div><div>Markus M<br></div> <div><div><br>><br>> Regarding the python code, thank you for pointing that out. I will surely review that part.<br>><br>> All the best,<br>> Nagy Edmond<br>><br>> On Fri, Dec 15, 2017 at 11:06 PM, Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<br>>><br>>><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>>> 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>>> then run make in the folder v.lcp.network. You might need to set MODULE_TOPDIR with something like<br>>><br>>> export MODULE_TOPDIR=/path/to/grass-source make<br>>><br>>><br>>> Some comments on the module:<br>>><br>>> You don't need both the -v and the -w flag, they are mutually exclusive. E.g. only the -w flag is enough:<br>>> -w flag not set: use r.cost<br>>> -w flag set: use r.walk<br>>><br>>> How to get the number of points in a vector:<br>>> pointnb = grass.vector_info_topo(map=vInput)['points']<br>>><br>>> You could eliminate the inner for loop at L180, this would vastly speed up the module:<br>>> 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<br>>><br>>> HTH,<br>>><br>>> Markus M<br>>><br>>> ><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>><br></div></div></div></div>