By David Crowther
Question:
How can I calculate the distance to multiple locations in QGIS?
Answer:
In this previous blog we explore a number of QGIS tools and plugins which allow you to perform routing analysis, including Shortest Path, Distance to Lines and Isochrone Catchment analysis - https://www.cadlinecommunity.co.uk/hc/en-us/articles/360001338178-QGIS-Routing-and-Distance-Tools
As a follow up to that Blog, we will now look at another option in the Network Analysis toolbox – Point to Layer.
In this QGIS project we have a line network from the Ordnance Survey – ITN_TF and a layer of Points for the School locations in this area – GuildfordSchools.
Using the Point to Layer tool we will calculate the distance from a chosen location (e.g. Home Address), using the road network to each of the end points represented by the School locations.
In QGIS choose Processing > Toolbox > and open the Network Analysis section.
Choose the Shortest Path > Point to Layer menu option and complete the menu below.
- Vector layer representing network – choose your road network.
- Path to Calculate – Shortest or Fastest (you can use Fastest if you have a road speed in your road network).
- Start Point – click in the map canvas to choose the start location.
- Vector layer with end points – choose the School Locations layer.
Press Run and the calculation from the start point to each end point (School Locations) will commence.
The output will be a new Line Layer, with a line segment from the start location (Home Address) to each end point (School Location).
If you open the attribute table, this new layer will have a record for each end Point (School) with the original School Attributes and now a new column on the end with the calculated distance – referred to as the Cost.
The Cost field now shows the Distance (in the Project units e.g. Metres) to each School from the chosen start location. This is therefore a great tool to use if you are looking to calculate the distance from a Home Address to multiple Schools, allowing decisions to be made for Travel Awards and/or School Applications.
Comments
0 comments
Please sign in to leave a comment.