By David Crowther
Question:
How can I calculate the distance from multiple locations to a given end point 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 – Layer to Point.
In this QGIS project we have a line network from the Ordnance Survey – ITN_TF and a layer of Points for Pupil Home addresses in this area – GuildfordPupils.
Using the Layer to Point tool we will calculate the distances from all of the Points (Pupil Home Addresses) using the road network to the end point represented by the School location.
In QGIS choose Processing > Toolbox > and open the Network Analysis section.
Choose the Shortest Path > Layer to Point 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).
- Vector Layer with Start Points – the Guildford Pupil locations layer.
- End point – click in the map on the School Location point.
Press Run and the calculation from each start point to the end point (School location) will commence.
The output will be a new Line Layer, with a line segment from the start location (each Pupils Home address) to the end point (School location).
If you open the attribute table, this new layer will have a record for each starting point (Pupils Home address) with the original Pupil 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 the School Location from each of the Pupils Home addresses. This is therefore a great tool to use if you are looking to calculate the distance from multiple Pupil Home Addresses to a chosen School, allowing decisions to be made for Travel Awards and/or School Applications.
Comments (0 comments)