I have a layer consisting of aprox. 20k lines

What I want to do:

In QGIS I want to be able to enter a start point and a end point. Preferably with street addresses and in second hand with coordinates. I then want a calculation of what lines that would represent the shortest path between these points. And then be able to export the result. The start and endpoint are usually not along the lines.

I've tried "Shortest Path" but i get an error

There is no route from start point to end point

As shown in the picture the red line is the line layer. The arrows represent the start and stop point. When the "processing" is done i would like to have the line in the red circle as "selected".

enter image description here

It is not roads and roads has nothing to do with the question.

  • 1
    What software and tools can you access? What have you tried? If you get stuck with that then ask about that specifically in this question which you can revise by using the edit button beneath it.
    – Taras
    Commented Jan 9, 2019 at 9:32

1 Answer 1


"Shortest path (point to point)" can do what you need. First, all your lines have to be in the same layer. Merge them if needed.

Then, to avoid your error, your lines need to be connected via nodes.

To connect intersecting lines via nodes, use "Split with lines" tool and choose your line layer as input as well as split layer. This will cut lines where they intersect.

enter image description here

Then run "Shortest Path (Point to Point)" on the splitted layer again.

In case they have no connection at all, there is of course no shortest - or at all, any path.

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.