I have a schematic diagram within QGIS consisting of a single layer of line segments. Lines have been snapped to others using "snap to segment". When using the snap to segment option the two lines that intersect do not share a common vertex.

I am attempting to use Road Graph to navigate the schematic, find paths and distances. The issue is that the shortest path algorithm requires two lines that share a common point.

Is there a plugin, script, or otherwise known procedure to add a common vertex/point on two lines that have been snapped using "snap to segment"?

enter image description here

1 Answer 1


Did not find anything native to solve this issue. Instead I wrote a python script that tested each vertex to see if it was on a line segment of another line.

Used code below to test if a point falls between points of a line segment.


Your Answer

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

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