QGIS
In this guide we demonstrate how to use GRID3’s friction surface to calculate the shortest travel time between two points using QGIS. We use the Nigeria mixed travel friction surface for this demonstration.
Step 1: Add friction surface to the project
Obtain mixed travel clipped friction surface for Nigeria and add layer in QGIS. The friction surface can be downloaded and manually clipped from here: https://academiccommons.columbia.edu/doi/10.7916/tw5k-ys98
Or clip and download using this tool (clipping to Katsina state for this example): [https://colab.research.google.com/drive/1WS4cDlm6ER0BKtntXXhNlLOWmsOW9qP8?usp=sharing](https://colab.research.google.com/drive/1WS4cDlm6ER0BKtntXXhNlLOWmsOW9qP8?usp=sharing)
The friction surface can be better visualized using a Singleband pseudocolor ramp with a max value of .05
Re-visualized friction surface
Step 2: Map projection
Ensure friction surface is projected to WGS84 - CRS “4326” using the Warp (Reproject) tool:
Step 3: R.cost
Run r.cost using the clipped and reprojected friction surface as the Unit Cost Layer and a start point: 7.515850,13.034015 and end point: 7.682362,12.923887:
Step 4: R.drain
To calculate the lowest cost path between the start and end point, run the r.drain tool using the Cumulative Cost raster and Movement direction raster from the previous step. Set the coordinates of the starting point as the end point coordinates from the previous step: 7.682362,12.923887:
Output lowest cost path
Step 5: Calculate travel time
To calculate travel time, zoom in on the coordinate representing the end of the travel path (7.682362,12.923887). With the Cumulative Cost layer selected, select the Identify Features Icon in the toolbar, and click on the raster cell to determine its value.
Find the Identify Features button
Click the pixel representing the end of the travel path and find the result in the Identify Results popup under Band 1 = 1.3717…
Step 6: Travel time in minutes
To get travel time in minutes, multiply the cumulative cost value by the friction surface pixel resolution (30 meters).
1.37 (accumulated friction surface value) * 30 (pixel resolution) = 41.1 minutes
This workflow can be applied to any of the GRID3 friction surfaces to calculate the shortest travel time between any two points.







