Interactively create route that snaps to route layer in QGIS

interactionlayersqgisroutingsnapping

There are many online tools for planning routes (e.g. Gaia GPS for hiking, Strava for cycling) in an interactive way (by clicking) such that the route generated conforms to an underlying route layer (e.g. OpenStreetMap roads or trails). For example, here is a screen recording of the Gaia GPS interface:
Screen recording of interactive route planning in Gaia GPS.

Does QGIS have any functionality or plug-ins that would allow a similar procedure?

Previous questions (e.g. How to route railcars along railroads? and Least cost path between various points QGIS) indicate that it is possible to generate snapping routes following a pre-defined set of points, which seems to be only a small step away from what I would like to do.

Best Answer

QGIS has en editing tool call Automatic tracing.

Here the documentation section of this tool :

  1. Enable the tracing Tracing tool (in the Snapping toolbar) by pushing the icon or pressing T key.

  2. Snap to a vertex or segment of a feature you want to trace along.

  3. Move the mouse over another vertex or segment you’d like to snap and, instead of the usual straight line, the digitizing rubber band represents a path from the last point you snapped to the current position. The tool also works with curved geometries

    QGIS actually uses the underlying features topology to build the shortest path between the two points. Tracing requires snapping to be activated in traceable layers to build the path. You should also snap to an existing vertex or segment while digitizing and ensure that the two nodes are topologically connectable through existing features edges, otherwise QGIS is unable to connect them and thus traces a single straight line.

  4. Click and QGIS places the intermediate vertices following the displayed path.

Related Question