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

Markus Metz markus.metz.giswork at gmail.com
Sat Dec 16 13:05:34 PST 2017


On Sat, Dec 16, 2017 at 7:41 PM, Edmond Nagy <nagy.edmond.eno at gmail.com>
wrote:
>
> Hi Markus,
>
> Thank you for your patience and your feedback.
>
> First of all, I would like to ask a couple more questions about the make
file.
> 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.

The Makefile must be exactly
-->
MODULE_TOPDIR = ../..

PGM = v.lcp.network

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

default: script
<--

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
export MODULE_TOPDIR=/path/to/grass-source make

MODULE_TOPDIR is the path to the main GRASS source folder

I understand you are using Microsoft Windows. You might need to compile
GRASS from source in order to test your module, please read

https://trac.osgeo.org/grass/wiki/CompileOnWindows

HTH,

Markus M

>
> Regarding the python code, thank you for pointing that out. I will surely
review that part.
>
> All the best,
> Nagy Edmond
>
> On Fri, Dec 15, 2017 at 11:06 PM, Markus Metz <
markus.metz.giswork at gmail.com> wrote:
>>
>>
>>
>> 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/20171216/81c15ced/attachment.html>


More information about the grass-dev mailing list