QGIS – Valhalla Point to Point

Marketing
Marketing
  • Updated

By David Crowther

QGIS___Valhalla_Point_to_Point_-_1.PNG

Question:

Can you undertake point to point routing in QGIS?

Answer:

Yes, in this previous FAQ we started to explore the QGIS plugin – Valhalla – to undertake drivetime isochrone analysis.

https://www.cadlinecommunity.co.uk/hc/en-us/articles/4410465055377-QGIS-Valhalla-Isochrones

We will use the same Valhalla plugin to now run Point to Point routing.

Open the QGIS Plugins tool and search for Valhalla.

QGIS___Valhalla_Point_to_Point_-_2.PNG

Once you have found the plugin, choose Install Plugin.

QGIS___Valhalla_Point_to_Point_-_3.PNG

It will be installed and accessible under the Web menu.

QGIS___Valhalla_Point_to_Point_-_4.PNG

To use the Valhalla tool, you will need to setup the Provider Settings. Before we do that, we will need to get our API key from the provider of the online routing service, which is MapBox.

If you haven’t already created a MapBox account, then follow this blog to get started –

https://www.cadlinecommunity.co.uk/hc/en-us/articles/360000603618-MapThat-Create-your-own-MapBox-Access-Tokens

Within MapBox you can choose the Navigation > Directions API page.

QGIS___Valhalla_Point_to_Point_-_5.PNG

On the Directions API page, copy the public access token shown in the window to the left of the map.

QGIS___Valhalla_Point_to_Point_-_6.PNG

Back in QGIS, choose Web > Valhalla > Provider Settings and choose the MapBox option.

QGIS___Valhalla_Point_to_Point_-_7.PNG

Paste in the public access token into the API Key window and press OK.

To now run the tool, choose Web > Valhalla > Valhalla.

QGIS___Valhalla_Point_to_Point_-_8.PNG

Choose the Provider to be MapBox, and then in the Valhalla window choose the task you wish to perform, which include:

  • Point to Point Routing
  • Isochrones
  • Source to Target
  • Locate
  • Centroid
  • Extract

In this example, we will choose the route option (which gives us Point to Point routing), and from the Go With option we can choose automatic, truck,  bicycle or pedestrian.

QGIS___Valhalla_Point_to_Point_-_9.PNG

We will choose auto.

Then from the Mode we can either choose fastest or shortest – dependent on the task you have.

QGIS___Valhalla_Point_to_Point_-_10.PNG

To now generate the point-to-point route , you need to add a starting and ending point into the map.

  • To add one starting point, choose the green plus button and left click in the map at your chosen start location.
  • To add stop off locations, choose the green button and left click in the map to add multiple stop locations.
  • Finally,… to add an end location, choose the green button and left click in the map to the ending point.

QGIS___Valhalla_Point_to_Point_-_11.PNG

The starting, stop off and end points are then added into the Valhalla tool window.

QGIS___Valhalla_Point_to_Point_-_12.PNG

If you need to remove a starting point, select the point in the list and choose the Red X button.

There are then a number of settings and parameters that you can choose, including:

  • Costing Options
  • Avoid Locations

Choose Costing Options. These allow you to set the routing options e.g. if Tolls should be avoided etc…

QGIS___Valhalla_Point_to_Point_-_13.PNG

Choose Avoid Locations. These are locations that the route must avoid, and they can be loaded from a layer.

QGIS___Valhalla_Point_to_Point_-_14.PNG

Having changed the configuration as desired….choose Apply, and the point-to-point routing will be calculated.

The output is a scratch layer, which has is a line object representing the optimum route from the start to the end point, including any stop offs.

QGIS___Valhalla_Point_to_Point_-_15.PNG

Why not download the Valhalla plugin yourself and see how you can create point to point routes using your data? It’s a great way to undertake spatial analysis such as:

  • quickest route to a School
  • best route to take to make drop offs/stop offs e.g. for a Maternity Nurse doing home visits.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.