Skip to content
Till Frankenbach edited this page Oct 5, 2023 · 11 revisions

ORS Tools QGIS plugin

This plugin enables easy usage of openrouteservice API's in QGIS. Most endpoints can be used interactively from the map canvas or in batch from Point layers. Note, layers have to be single geometry Point layers, not MutliPoint layers. CRS different from WGS84 will be handled automatically.

TOC

Installation

The ORS plugin is available over the official QGIS plugin repository and is best installed from the QGIS built-in Plugin Manager. However, if you want or need to install the latest development version:

  1. Download the ZIP archive from the main branch
  2. Unzip and copy the folder ORStools into your system's QGIS plugin directory:
  • Linux: ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins
  • Windows: C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
  • Mac OS: Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
  1. Restart QGIS and if necessary, activate the ORS Tools plugin over the Plugin Manager.

Setup

First, you'll have to sign-up and register your API key in your dashboard.

In the configuration window (Web > ORS Tools > Configuration) you have set up the API key, which will be saved locally in a configuration file and will automatically be used across all tools. Here you can also set the base URL in case you're using a self-hosted ORS version and the requests per minute you're allocated (usually set to 40).

ORS Tools config

Usage

The plugin offers 2 entry points for usage:

GUI

The standard GUI is launched either from the Web toolbar or the Web menu:

ORS Tools GUI

You'll find a shortcut to the configuration settings and the wiki here. Also, it will show you your available requests for the current period of time (usually one day) as soon as you made the first request in the current QGIS session.

Routing GUI

Parameters

You can use all available profiles from openrouteservice, including wheelchair (only available for Europe), for the fastest or shortest route. In the Advanced dialog you can set avoidables to be considered during route finding.

Input features

As input, either map start and locations directly from the map canvas by clicking the green plus button buttons and choosing a location in the map canvas, or use Point layers to route from/to. Batch operations involving whole layers are better performed using the Processing tool. The Unique ID fields let you specify the ID's being used to identify the output features, enabling joining of output and input layers.

If you're using a layer for start and end locations, you can choose the mode. Row by row will route from each row in the start layer to the corresponding row in the destination layer. All-by-All will route each feature of the start layer to each feature of the destination layer, basically performing a matrix calculation. Use this option with care. In case you don't need the output geometries, but you're only interested in a table of the distance and/or duration, consider using the Matrix API.

Output features

For each operation a LineString layer will be output, which contains the following properties:

  • DIST_KM: the calculated route distance in kilometers
  • DURATION_H: the calculated route duration in hours
  • PROFILE: the transportation mode being used
  • AVOID_TYPE: a pipe (|) separated list avoidables
  • FROM_ID: the values of the ID field used in the From layer
  • TO_ID: the values of the ID field used in the End layer

Isochrones GUI

Parameters

Here you also specify the travel mode. Additionally you can choose the dimension to use in the calculation, which will also determine the unit of the Ranges parameter. If time is chosen the ranges have to be in comma-separated minutes of integer type (i.e. whole numbers), in case of distance the unit is in meters.

Input features

In the GUI, you can only choose points in the map canvas. When you're choosing a point on the map, a geocoding request is sent and information on the clicked location is shown to you in the field on the left. If you want to use input layers, you'll have to use the isochrone processing tool.

Output features

Each operation will result in one Polygon layer and contains the following properties:

  • ID: redundant, will always be 0
  • AA_MINS/AA_METERS: the isochrone value
  • AA_MODE: the transportation mode used
  • TOTAL_POP: the total population within the isochrone/equidistant according to the GHSL dataset

The output layer has an auto-styling with a categorized classification on the isochrone values.

Matrix GUI

This tool has entirely moved to the Processing toolbox.

Processing Provider

All ORS endpoints are now also accessible in the Processing module, making it possible to use them in standalone scripts, model builder etc. This is the preferred (and mostly only) method for batch operations.

Routing Processing

The routing processing algorithm is very similar to its GUI equivalent. It is the preferred way to make batch routing requests.

Isochrone Processing

It has the same functionality as the isochrone tool with the exception of being able to use Point layers as input. The ID field can be used to join input and output features.

Matrix Processing

The Matrix tool calculates a N x M route matrix and outputs a geometryless table.

Paramters

You can only choose the travel mode here.

Input features

You can choose layers as start and end locations each containing up to 50 features, according to our restrictions (note, subject to change). The ID fields can be used to identify input features in the output table.

Output features

For each operation a geometryless table is output with the following columns:

  • FROM_ID: the values of the ID field used in the From layer
  • TO_ID: the values of the ID field used in the End layer
  • DURATION_H: the calculated route duration in hours
  • DIST_KM: the calculated route distance in kilometers

If a route could not be found, the results will be NULL.

Logging

Generally the plugin logs to its own QGIS log (View > Panels > Log Messages) on two occasions:

  • on each API request it logs the full URL, which helps in debugging and which you should include in Github issues
  • on API errors thrown by the ORS backend

For the processing algorithms, errors are also reported in the Log tab.