[GIS] Calculating distance between points of same layer using QGIS

distancedistance matrixnearest neighborqgis

I am using QGIS 2.13 and a layer with hundreds of points. I need to calculate the distance to the nearest point… in the same layer. I tried the distance matrix but I get 0m since the "closest" point is the origin point.

The idea is calculate the average distance, std deviation, etc. and create a graph/histogram with these data to see how the distribution looks like.

Does anybody know how to calculate the distance to the nearest point in the same layer avoiding the origin point?

Best Answer

There are a couple of versions of this tool. If you use the one from the Processing Toolbox, it will contain distances within the origin points. Instead, use the Distance Matrix tool from the menubar:

Vector > Analysis Tools > Distance Matrix

This version ignores calculating the distance of the origin points with itself.

Related Question