I have two layers. First layer defines the starting points and the second defines the end points. I just want to iterate the same algorithm "point to layer" by considering all the points of the first layer one by one and get the shortest point.

  • Not sure what you mean by 'iterate the same algorithm "point to layer"'. To clarify, if you had start points A and B, and end points Y and Z, you'd want to evaluate distances AY, AZ, BY, BZ to find the shortest? Or do you want to find the starting point for each end point that gives the smallest distance: evaluate AY and BY to find the smallest distance, then AZ and BZ?
    – Lance
    Commented Jan 28, 2020 at 7:33

1 Answer 1


Make sure each layer has a unique identifier field and utilize the Distance Matrix tool under Vector-Analysis Tools. Set Input point layer to one layer and Target to the other, then set the output matrix type to Linear (N*k x3) distance matrix. This produces a table showing the distance between all points in the Input layer with all points in the Target layer. Sort by the Distsance column in the table's attribute table and you have all the distances ranked in order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.