[GRASS-user] shortest distance within a points layer

Moritz Lennert mlennert at club.worldonline.be
Mon Aug 11 11:42:43 EDT 2008


On 11/08/08 17:02, Markus Neteler wrote:
> On Mon, Aug 11, 2008 at 12:02 PM, G. Allegri <giohappy at gmail.com> wrote:
>> Hi list.
>> I need to evaluate the shortest distance between the points of the same layer .
>> v.distance fails as to_map and from_map overlap (every shortest
>> distance is obviously 0: from point to itself). I was considering the
>> use of network analysis tools... but I don't see a straigthforward way
>> with them.
> 
> The best would be to have v.univar calculate these values.
> Min and max algorithms are already built-in, it "just" needs
> to be extended to consider not only attributes but also geometry.
> (maybe with a flag to consider geometry instead of attributes?)

IIUC, Giovanni is not looking for one number, i.e. minimum of all the 
distances between points in a map, but rather for the distance from each 
point in a map to the closest other point in the same map. Please 
correct me if I'm wrong.

The attached diff seems to work, but needs testing. I also filed this as 
an enhancement wish in the tracker.

Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.distance_dmin.diff
Type: text/x-patch
Size: 1633 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080811/a900cae4/v.distance_dmin.bin


More information about the grass-user mailing list