# Creating a Safe Route to School Map with OS NGD Transport Network

### Software Requirements

QGIS 3.24 or later

### Data Requirements

* Import your `roadlink`, `pathlink`, `connectinglink`, and `averageindicativespeed` data into QGIS
* Filter `roadlink`, `pathlink`, and `averageindicativespeed` further if needed, e.g. if only interested in roads under 30mph
* Import your residential and educational addresses into QGIS
* Select a school of interest from educational addresses and create this as a new layer

## Building the network

QGIS has built in tools for network analytics such as service area and shortest path. However, for a visually clearer output, we will be using a plugin called QNEAT3.

Select ‘*Plugins’ > ‘Manage and Install Plugins’* and search for ‘*QNEAT3’.* Select ‘*Install Plugin’*.

<figure><img src="/files/31PF7YT2yb02tsFOtVoZ" alt="Image of the QNEAT3 plugin for QGIS"><figcaption></figcaption></figure>

Once the plugin is installed, it will appear in the processing toolbox. The tool offers various analysis options, but for now select *QNEAT3 – Qgis Network Analysis Toolbox* > *Distance Matrices* > *OD Matrix from Layers as Lines (m:n).*

This will create a network output of the shortest paths between two sets of points.

### Creating the initial network

Using the Merge Vector Layers function, merge `roadlink`, `pathlink` and `connectinglink` layers together to make one layer, which will act as the base for your cost network

<figure><img src="/files/KBAUJWw8EYPlJtZMvStQ" alt=""><figcaption></figcaption></figure>

### Creating the shortest distance network

* Use your merged `roadlink`, `pathlink` and `connectinglink` layer as your Network Layer
* Set From-Point Layer as residential addresses
* Set To-Point Layer as the example school address
* Set Generated matrix geometry style to be *Matrix geometry follows routes*

<figure><img src="/files/WQ7kaPAJJYox4bTcJ5V6" alt=""><figcaption></figcaption></figure>

### Joining attributes to the output network

Use **Join attributes by location (summary)** with `averageindicativespeed`, joining to your new network and calculating mean `indicativespeedlimit_mph` along the routes

<figure><img src="/files/FAmcNO54ISKQMM8JQE07" alt=""><figcaption></figcaption></figure>

Again use **Join attributes by location (summary)** with the merged `roadlink`, `pathlink` and `connectinglink` layer, joining to your new network and calculating mean `presenceofstreetlight_coverage` and `presenceofpavement_overallpercentage`

<figure><img src="/files/7TGqbZddkeMtdQymuhX6" alt=""><figcaption></figcaption></figure>

### Adding a Score attribute

Open the *Field Calculator* in QGIS.

Add new attributes called `streetlightrating`, `20mphzone` and `presenceofpavementrating`, to OD Matrix layer and calculate a numerical value to these according to requirements.

Multiply these scorings together to get one overall rating for each route to school and style accordingly to highlight hotspots of safe and less safe routes

<figure><img src="/files/P3nkIc2SqdXhQqTdyO6x" alt=""><figcaption></figcaption></figure>

### Example Output – RAG Map

Each potential route from an address to the school is classified into Red, Amber and Green, which can help to highlight areas which may be less safe for school transport.

Routes can either be isolated if interested in a specific area or combined to give a clearer picture of walkability over a wider area.

Note that these are example ratings to demonstrate output and should not be taken verbatim.

<figure><img src="/files/Rp29WgUtfaN8paKlPQ7m" alt=""><figcaption></figcaption></figure>

### Possibilities to Enhance Results

* Filtering by Bus to look at bus routes to schools, and including bus stop data (e.g. NAPTAN)
* Look at crime statistics which may also affect route safety (e.g. ONS)
* Look at additional pavement attribution such as width of pavement for accessibility for buggies (in OS Data)

## Creating the RAG Map - step by step process

* Import your `roadlink`, `pathlink`, `connectinglink` and `averageindicativespeed` data into QGIS
* Use Merge Vector Layers to combine `roadlink`, `pathlink` and `connectinglink` into one layer to create a combined network layer
* Import your residential and educational addresses into QGIS
* Select school of interest and create this as a new layer
* Use *OD Matrix from Layers as Lines (M:N)* from *QNEAT3* Plugin, using your combined network as your Network Layer, From-Point Layer as being residential addresses, To-Point Layer being the school address and setting cost strategy to be along network features
* Use *Join attributes by location (summary)* with RAMI, joining to your new network and calculating mean `indicativespeedlimit_mph` along routes
* Use Join attributes by location (summary) with your combined network, joining to your new OD Network and calculating mean `presenceofpavement_overallpercentage` along routes
* Use Join attributes by location with your combined network, joining to your OD Network, setting the join type to ‘largest overlap (one-to-one)’ and taking the `presenceofstreetlight_coverage` attribute
* Add new attributes called ‘`streetlightrating`’, ’`20mphzone`’ and ‘`presenceofpavementrating`’, to OD Matrix layer and calculate a numerical value to these according to requirements
* Multiply these scorings together to get one overall rating for each route to school
* Style accordingly to highlight hotspots of safe and less safe routes


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.os.uk/more-than-maps/routing/safe-routes-to-schools/creating-a-safe-route-to-school-map-with-os-ngd-transport-network.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
