[GRASS-dev] patch for v.nn.py

Moritz Lennert mlennert at club.worldonline.be
Sat Sep 14 09:11:05 PDT 2013


Michael,

I've attached a patch to your very useful v.nn.py addon script. The 
patch provides the following:

- a change of option names from input1,2 to 'from' and 'to'
- the possibility to provide a vector map with polygons giving the 
contours of the study area for which to calculate the nearest neighbor 
coefficient - the script just gets the total of all areas and all 
perimeters in the given map
- the possibility to provide numerical values for area and perimeter

Even though some people argue that the absolute value of the coefficient 
does not mean much and that the exact size of the study area does not 
have an influence on the relative values of the coefficient, I think it 
is a plus to have the possibility to circumscribe the area. Especially 
since in its current state the module gets the area and perimenter from 
the current region and as this is a vector module most people won't even 
think about region settings. (Running the module in the default n=1 s=0 
w=0 e=1 region gives very weird coefficient values.

Up to you to decide whether you want to add this into your script.

BTW: the script works perfectly in grass7 as well.

Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.nn.py.diff
Type: text/x-patch
Size: 4078 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20130914/4ee01b75/attachment.bin>


More information about the grass-dev mailing list