I have a graph layer and a point layer. The points are snapped to the graph. I want to get the distance between the closest points on the graph
1 Answer
Solution 1: Beeline distance
Use distance matrix tool for a quick and dirty solution: ignoring the network, just beeline distance (for using network, see below). At least from your screenshot, this should be more or less the same for the shortest distance.
Run Menu Processing > Toolbox > Distance Matrix and use the same layer for Input and Target point layer. Open the attribute table of the the resulting layer and sort the column Distance
to get the shortest distance: InputID
and TargetID
shows you the point pair that has the smallest distance in between:
Solution 2: Distance over network
To do the same, but using network distances, use the plugin QNEAT3 and run one of the OD Matrix tools like OD-Matrix from Points as Table (n:n)
.