QGIS – How to Autoadjust One Line to Another Nearby Existing Line

linelinestringqgis

I have the line created by the "Point to path" function. The algorithm produces just a straight line, whereas I would like to have this line auto-adjusted to the other line (or buffer) which actually exists.

enter image description here

I found the solution here:

How to Make Lines Automatically Adjust same with Another Line (Route or Road)

but it's based on the Snapping tool, which still requires some manual work even if I enable tracing.

I am wondering about some option, which would adjust the line automatically to the selected line from another layer.

Best Answer

You can use the shortest path (point to point) tool for this purpose. To run it for multiple instances you can use the batch processing interface