Routing point sequences
In the recipes so far, we routed from one starting point to one destination point. Another use case is when we want to compute routes that connect a sequence of points, such as the points in a GPS track. In this recipe, we will use the point layer to route processing script to compute a route for a point sequence. At its core, this script uses the same idea that was introduced in the previous recipe, Calculating the shortest paths with the QGIS network analysis library, but this computes several shortest paths one after the other.
Getting ready
To follow this recipe, load network_pgr.shp
and sample_pts_for_routing.shp
, which contains a point layer that should be routed from the sample dataset.
Additionally, you need to get the point layer to route script from https://raw.githubusercontent.com/anitagraser/QGIS-Processing-tools/master/2.6/scripts/point_layer_to_route.py and save it in the Processing
script folder, which is set to C:\Users\youruser\qgis2\processing\scripts...