Monday, November 18, 2013

Simple shortest path analysis using QGIS Road Graph plug-in

There is a Road Graph plug-in that can be installed in QGIS, and used to perform directional and non-directional shortest path analysis. Using the plug-in is quite straight forward, provided the network data is available and topologically clean. The following is an example showing a non-directional shortest path calculation using a linear metro network layer from a SpatiaLite database but it could from any GIS format.

  1. Start up QGIS 2. Load and display a linear network layer e.g. segments.

  2. Select Vector | Road Graph | Settings.

    The Road graph plugin settings appear.

  3. In the Layer field, choose the linear network layer e.g. segments.
  4. Optional. In the Time unit field, choose the time units to report on e.g. minutes.
  5. Optional. In the Distance unit field, choose the distance units to report on e.g. meter.
  6. Optional. In the Topology tolerance field, type in a non-zero value, if there are gaps in your linear network. Leave it zero if your network is topologically clean.
  7. Click the Default settings tab.

  8. In the Direction field, I chose Two-way direction as my network is bi-direction.
  9. Click OK.
  10. In the Shortest path pane's Start field, click the "cross" button.

  11. Click a starting point of the analysis in the map.
  12. In the Shortest path pane's Stop field, click the "cross" button. Click the ending point in the map.
  13. In the Criterion field, choose Distance.
  14. Click Calculate.

    The shortest path by distance is calculated and displayed in the map.

No comments: