Service area analysis is useful in evaluating accessibility of locations. Given locations of fire stations, hospitals, public transit stations etc. you can use such analysis to identify what areas can be served from these locations by either amount of distance traveled or by time taken. Till recently, such analysis was difficult using open-source tools and data. But now we have access to a global street network using OpenStreetMap (OSM) and free web-services such as Openrouteservice (ORS) that can perform complex routing tasks using OpenStreetMap (OSM) data. In this tutorial, we will use the ORS Tools Plugin to perform service area analysis in QGIS.
We will use metro rail station data for Kochi, India to determine areas that are within 15-minutes of walking distance.
Kochi Metro Rail Limited (KMRL) provides open data for the Kochi Metro Rail Project in Global Transit Feed Specification (GTFS-static) format. Request for data download by visiting the Open Data page.
For convenience, you may directly download a copy of the datasets from the links below:
Data Source [KMRL]
Openrouteservice API provides routing algorithms that work on free geographic data from OpenStreetMap. It is a free web-based service that can be accessed via a QGIS plugin. While the service is free, it requires you to sign-up and get an API key. The API key is used to prevent abuse and enforce limits on usage.
Free
as the Token type and enter ORS Tools QGIS
as the Token name. Click CREATE TOKEN.Key
. This is a unique identifier linked with your account that will be used to authorize use of this service.key
(copied in step 2) in the API Key text-box. Click OK.KMRL-Open-Data.zip
file to a folder on your computer. You will notice that the unzipped directory contains many text files. Each file contains data for a different aspect of the transit system. The format of the files and their uses are described in GTFS Reference. Out of all the files, 2 files contains geospatial data and is of interest to us. The file shapes.txt
contains points that describe a physical path that the vehicle takes, and the file stops.txt
contains the location of each transit stop. Both of these are CSV files that can be imported into QGIS. Click the Open Data Source Manager button.shapes.txt
file. Select CSV (comma separated values)
as the File Format. The X field and Y field should be auto populated. Click Add.stops.txt
file. Click Add. Click Close.stops
and shapes
added to the Layers panel. Let’s convert the shapes
point layer into a line layer representing the path of the metro line. Go to .shapes
as the Input point layer. As per GTFS specifications, each individual route has a unique shape_id
so select that as the Group field. We can also specify the order of points that will form the line by selecting shape_pt_sequence
as the Order field. Click Run.Paths
will be added to the Layers panel. You can turn off the visibility of the shapes
layer to see the newly added line layer.openrouteservice
as the Provider. We will be computing a 15-min walking distance polygon from each metro station. Select stops
as Input Point Layer. Select stop_id
as the Input Layer ID Field. From the Travel mode drop-down, select foot-walking
. As we are interested in time-based area, select time
as the Dimension. Finally enter 15
minutes as the ranges. Click Run.Note
Note that the Openrouteservice API has a limit of 20 requests per minute for Isochrones. So if your layer has more than 20 points, you may see errors indicating that the rate limit exceeded. You can keep the tool running and it will continue processing 20 points / min.
Isochrones
loaded in the Layers panel. Each point has an associated polygon representing the area that is accessible within 15 minutes by walk. To see this in the context the data that was used to generate them, we can add the OpenStreetMap basemap. Scroll down the Browser panel and locate . Drag it to the canvas.OpenStreetMap
will be added to the Layers panel. Drag it down to change the layer order and keep it at the bottom of the layer stack. Zoom and pan to see if the results match the road network. You will see that the polygons are not circular, because the travel time is computed along roads, so the regions that have no roads will have lesser area covered.Isochrones
as the Input layer and click Run.Dissolved
will be added to the Layers panel. This polygons represents the full region that is accessible from the metro system within 15-minutes of walk.Note
This is a simple example of how a service area analysis for a public transportation project can be done in QGIS. A more comprehensive service-area analysis for the metro system would include other modes of transport. We could include feeder buses, nearby bus stops and routes serving those bus stops to expand the analysis. We may also include travel by other modes such as car and taxi.
This work is licensed under a Creative Commons Attribution 4.0 International License