Creating Isochrone Travel Time Maps in QGIS with OpenRouteService

From CUOSGwiki
Jump to navigationJump to search

Introduction

Isochrone maps are a map type which represent a geographic extent accessible within a certain time threshold from a specified point or line. They often represent travel time on foot, by car, or by transit services.

This tutorial will provide a walkthrough in the creation of isochrone maps, how to manipulate the output based on their intended use and audience, and a way to host them online to be accessible by other users.

The software to be used for this tutorial is QGIS. Visit their website to download the software at this link. Find an installation guide here if you need assistance through the download process.

Data & Plugins

With the QGIS software downloaded and open, follow the next steps to attach all the necessary plugins and tools to your QGIS interface.

HCMGIS

This tutorial will use the HCMGIS plugin to source basemap. Through this plugin, you can instantly load basemaps from multiple sources, like Google Maps (including satellite imagery), ESRI, and other cartographic services. It also facilitates downloading OpenData, but a different option for doing this will be explored in this tutorial.

From the Menu Toolbar of the QGIS interface, find Plugins and select Manage and Install Plugins. Under All, search for HCMGIS, and click Install Plugin.

Installing the HCMGIS plugin

Once installed, you should see HCMGIS listed in the QGIS Menu Toolbar.

Using the HCMGIS plugin, add the ESRI Topographic basemap to your project.

QuickOSM

Use the same method as in the HCMGIS section to access the Plugin repository, and install the QuickOSM plugin.

The plugin page for quickosm installation

Usage of QGIS for projects and analysis will show that QuickOSM is an indispensable resource which allows simple but in-depth querying of open data, which is instantly downloaded from OpenStreetMap and added to your project.

The QuickOSM toolbar should now be added to the Toolbars present in your QGIS project pane. Look for the following symbols:Quickosmtoolbar.jpg

ORS Tools

The final plugin to install before beginning to create is ORS Tools. It is found in the plugin repository and should be installed in the same manner as HCMGIS and QuickOSM before.

Orstools.jpg


OpenRouteService API Setup

The OpenRouteService API provides routing services and capabilities, which can be utilized through software like QGIS to compute, in this case, travel times from points or lines. Navigate to the OpenRouteService webpage at this link.

From the log-in screen, choose the option to Sign Up for a new account. Fill in your account information, choosing Education as the purpose of the account.

You will need to verify your account through a link sent to the email used for sign-up.

Once your account has been verified, logging in should direct to the OpenRouteService API documentation. Click on your profile icon in the top right Orsprofile.jpg to create or access your API token. A free token should have been created alongside your account, but if it requires you to create a token, choose the Free token and fill in a descriptive name. Each OpenRouteService account grants the user access to one free key which permits the computation of 500 isochrones per day.

Once your API key has been generated, clicking on your profile should present you with the following screen:

OrsAPI.jpg

Your redacted key is listed at the top. Clicking on the text or the copy button will copy the entire key to your computer clipboard.

Returning to QGIS, find the Web tab on the Menu Toolbar, and hover over the ORS Tools option. From the expanded menu, select Provider Settings.

Orstoolskey.png

In the subsequent pop-up menu, expand openrouteservice. In the API Key field, paste your token that you copied from your ORS account. Click Save.

Orstoolsprovider.png


Data Acquisition

Click on the green magnifying glass Quickosmtoolbar.jpg to open the QuickOSM query tool. Set the parameters of a Quick Query as shown below to download the lines and stations of the O-Train network, including the current operating extent, and the future East and West extensions. The Advanced parameters shown will ensure that the lines and points are downloaded, and are immediately saved to a named Shapefile in your project directory.

LRTextraction3.jpg

The output will require the following tweaks to properly visualize the O-Train system:

Stations

  • Rename point layer to LRT Stations
  • Change to a categorized symbology.
  • Set value to railway.
  • Deselect all node types except station.
  • Change the station symbol to an icon which will display well over the basemap and route lines.
  • With the LRT Stations layer selected, use the Select Features by Area or Single Click tool Selecttool.jpg to select all stations West of Tunney's Pasture, representing the Stage 2 West extension, as pictured below:

Westextension.jpg

  • With these stations selected, right click the stations entry in the Layers pane, and select Export -> Save Selected Features As..., and save the selected points as an aptly named shapefile, ensuring to check the box to add the new file to your project.

Routes

  • Rename lines layer to LRT Routes
  • Change to a categorized symbology.
  • Set value to name.
  • Change Confederation Line and East and West Extensions to a red line.
  • Change Trillium Line to a green line.
  • Change Trillium Line - Airport to a light blue line.
  • Deselect all other values item to hide storage and maintenance trackage.

Ensure the Stations point layer is drawing above the Routes line layer, and you should be left to an output similar to this:

LRTmap.jpg


Isochrone Creation

The most convenient way to access the ORS Tools plugin is through the QGIS Processing Toolbox. If your toolbox is not open, you can find it under Processing in the Menu Toolbar, by clicking the icon QgispToolbox.jpg, or by pressing Ctrl + Alt + T.

In your toolbox, you should see a listing for the ORS Tools plugin installed earlier. Expand the ORS Tools section, and open the Isochrones submenu. Listed here are shortcuts to the isochrone creation menus. The options are Isochrone from Point which allows you to manually choose a single point on your map canvas to calculate travel times, or Isochrones from Point-Layer which computes travel times from an existing point(s) layer in your project.

Orstoolbox.jpg

LRT West Extension

For this first step, choose Isochrones from Point-Layer.

Look through the list of parameters to be set in the creation menu.

Provider
Ensure set to openrouteservice
Travel mode
To choose which method of travel you'd like your times to be based on. Set to foot-walking
Input Point layer
The points from which the travel times will be calculated. Set to your West extension stations layer.
Input ID Field
Choose if any values transfer to the travel time polygons. Can be left blank.
Dimension
Choose whether ORS calculates travel time or travel distance. Set to time
Comma-separated ranges
This is where you choose which time thresholds you would like to be calculated from your points, in minutes. These must be whole numbers, with values above one hour remaining in whole minutes (i.e. 1.5 hours = 90). Enter 5, 15 here.
Location type
This sets your points as either the start point of travel, or the destination. For small scale analysis like in this tutorial, these differences are often negligible. Leave as start.
Advanced Parameters
Several additional parameters can be set to further manipulate the output to your desires. Here you can choose a smoothing factor to simplify the output polygons, you can specify features to avoid like borders, ferries, or toll roads (based on OpenStreetMap data), or polygon layers present in your project.

Be sure to also set the output to save to a file type of your choice.

Isochronesettings.jpg

Setting the isochrone parameters as shown above should result in an output similar to this:

Isochroneoutput.jpg

The default output symbology often leaves something to be desired. Methods to improve the visualization of these isochrones will be explored in the Symbology section.

Isochrones from Point

The visualization of walking times to multiple points as shown above is a useful small scale tool for local residents, but isochrones can convey much more information.

For this step, choose a major city in Europe and find it on your map canvas. This tutorial will be using Hamburg, Germany as an example.

In your processing toolbox, select Isochrones from Point under ORS Tools -> Isochrones.

The parameters menu is identical to that of the point layer option, save for the Input Point. In this menu, clicking the three dots to the right of the text box will allow you to manually select a single point on your map where the calculations will be based.

After choosing a point central to your European city, you should be returned back to the parameters menu.

For this process, choose driving-car, and set your comma separated ranges to 10, 20, 30, 40, 50, 60. This will create separate polygons representing 10 minute intervals up to an hour of driving time from your chosen point.

Click Run.

These computations are more complex and will take more time to complete, but usually not more than about 10 seconds.

Once this process is complete, you should be presented with something similar to the image below:

Hamburgrawouptut.jpg

Output Refinement & Symbology

LRT Stations

There is large amounts of overlap between the 15 minute walk polygons. This would be best represented as one continuous extent since all areas within are closer than a 15 minute walk, there is no need for the extent to be defined while already within the extent of a different polygon. Use the Dissolve tool to merge these polygons together.

  • Within the Dissolve tool menu, ensure the Input Layer is set to your station isochrones.
  • Under Dissolve field(s), click the three dots to the right, selecting AA_MINS from the subsequent list. Click OK.

Advanceddissolve.jpg

  • Fill in the parameters to save the dissolved polygons to a permanent file if you wish, and click Run.

You should see the following output on your map canvas: DissolvedisochronesLRT.jpg

The following steps will provide a symbology method which should serve the target well and meet the goals of this process, but it is encouraged that you experiment with the styling of your output and continue to find new ways to improve the visual appeal and usefulness of your maps.

  • Open the symbology menu for your dissolved isochrones.
  • Change to a Categorized symbology, set the Value to AA_MINS.
  • Click classify.
  • Uncheck the all other values category. There should be no data of this type, but as a preventative measure.
  • Double-click the colour swatch of the 5 minute category to enter the symbology menu for that individual category.
  • Click into the Simple Fill listing under Fill.
  • Set the Fill Colour to a translucent green (~15% opacity). Set Stroke colour to a solid, darker shade of green.
  • Set the Stroke width to around 0.6 millimetres.

5minssymbol.jpg

Set the symbology for the 15 minute category to a similar style, using a different colour to differentiate the separate polygons and their meaning.

There is one more change to make in the layer symbology menu to improve the visualization of the isochrones. Under Layer Rendering, expand check Draw effects and click the star icon on the far right to enter the effect menu. In this menu, enable the layer to have a Drop Shadow. You can click on the drop shadow listing to manipulate the parametres of this effect:

Effects.jpg

The drop shadow provides the effect that the isochrones are sitting above the map canvas, giving the illusion of separation which might help the general audience of these maps understand where in the real world these lines are representing, rather than subconsciously redefining their understanding of the area.

Symbolizedisochrones.jpg

The final output of the guided symbology.


Hamburg

Begin your symbolization of your Hamburg isochrones much the same way as the LRT stations prior:

  • Categorized Symbology
  • AA_MINS value
  • Green - Red colour ramp, with green at smaller values.

Hamburg symbol1.jpg

  • Click into the main Symbol menu at the top of the layer symbology screen (click anywhere on the coloured rectangle).

Mainsymbol.jpg

Under the Simple Fill parametres, set Stroke Style to No Line.

Noline.jpg

While in the Simple Fill menu, enable Draw effects and add a drop shadow. Doing so in this general symbology menu will render a drop shadow between each individual isochrone.

Return to the layer properties menu, and double click the colour swatch of the 60 min category, and reset the Stroke Style to Solid Line. This will leave a line around only the absolute extent of your isochrones.

Scale back the opacity of the isochrone layer to ~50%.

Hamburg done.jpg

Following these steps will leave you with a visually striking, info-rich representation of travel times around your selected point. These instructions have only scratched the surface of QGIS's symbology capabilities, though. Experiment with as many settings as you can find, and continue learning how you can best shape your map output to the intended purpose.

Here's some more experimental approaches to isochrone rendering:

Experimentchrone.jpg


NYCiso.jpg


Conclusion

An isochrone map is a visually impressive, yet interpretable representation of travel times from a specified point(s). On first impression, creating such a map may be intimidating, but this tutorial shows how just a couple open-source softwares can make doing so accessible to anybody.

Some constraints should be noted about the quality of data acquired through the OSM plugin, and some ambitious ORS parameters will quickly teach you about the computational limits of the free tier API token. Despite this, you've also learned the capabilities of open source software, and how the continued development has increased interoperability and output quality.

Fun Facts and QGIS Tips

UTM Grid ESRI Server

  • Right click the ArcGIS REST Servers item in your QGIS Browser pane.
  • New Connnection
  • Enter UTM Zones as the connection Name.
  • Enter the following link into the URL box:
https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_UTM_Grid/FeatureServer
  • Click OK

This connection will now be listed in your Browser Pane, allowing you to quickly add a reference to find the correct UTM Zone number to set your CRS.

UTMgrid.jpg


Typing 'World' in the Coordinates Box

Typing the word world (case sensitive) will instantly load a Geopackage of the world map into your map pane.

World.jpg


Scrolling on Boxes to Change Values / Opacity

The following tip is most useful when working with an external mouse with a dedicated scroll wheel.

If you hover your cursor over the item you wish to change, so long as it is a list of settings to choose from, you can scroll through the options without actually clicking into the setting. When doing so over a colour selection, scrolling will decrease or increase the opacity.

Ctrl + Scroll for finer zooming

If you find that you cannot scroll to a good middle ground for the scale you wish your map to be, holding the Control button on your keyboard and scrolling will make much smaller adjustments and allow you to find that middle zoom level.


References

Desai, K. (2008). Isochrones: analysis of local geographic markets. Antitrust and Competition Review, 9, 26-32. https://www.mayerbrown.com/files/Publication/7633e871-05b8-428f-bbcd-cf6d9163bab8/Presentation/PublicationAttachment/c7b45b1f-d4f4-413c-b5aa-b0579c87049f/Isochrones-Desai_Iss2_1108.pdf