[GRASS-dev] [GRASS-PSC] GRASS add-on sharing and write access

Markus Metz markus.metz.giswork at gmail.com
Fri Dec 15 13:06:09 PST 2017


On Fri, Dec 15, 2017 at 5:50 PM, Luca Delucchi <lucadeluge at gmail.com> wrote:
>
> Hi Nagy,
>
> Il 15 dic 2017 5:42 PM, "Nagy Edmond" <nagy.edmond.eno at gmail.com> ha
scritto:
>
> Markus, thank you very much for helping.
>
> I have now included into the add-on directory the py, html and makefile
> files. The last one is an example I found somewhere, but I am not sure how
>
>
> You can have a look to makefile for addons in the svn repository [1]
>
> to adapt it, or how to run it (or from where) to generate the final html.
> Could you please tell me how it works, or point me to a working example?
>
>
> To understand how it works you can read the docs in the wiki about addons
compilation [0]
> I hope this is helpful

The Makefile must have this content:
-->
MODULE_TOPDIR = ../..

PGM = v.lcp.network

include $(MODULE_TOPDIR)/include/Make/Script.make

default: script
<--

then run make in the folder v.lcp.network. You might need to set
MODULE_TOPDIR with something like

export MODULE_TOPDIR=/path/to/grass-source make


Some comments on the module:

You don't need both the -v and the -w flag, they are mutually exclusive.
E.g. only the -w flag is enough:
-w flag not set: use r.cost
-w flag set: use r.walk

How to get the number of points in a vector:
pointnb = grass.vector_info_topo(map=vInput)['points']

You could eliminate the inner for loop at L180, this would vastly speed up
the module:
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

HTH,

Markus M

>
>
> Edmond
>
>
> Ciao
> Luca
>
>
> [0] https://grasswiki.osgeo.org/wiki/Compile_and_Install#Addons
> [1] https://trac.osgeo.org/grass/browser/grass-addons/grass7
>
> _______________________________________________
> grass-psc mailing list
> grass-psc at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-psc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20171215/4e93f6a8/attachment.html>


More information about the grass-dev mailing list