> For the complete documentation index, see [llms.txt](https://docs.os.uk/os-downloads/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.os.uk/os-downloads/products/transport-network-portfolio/os-mastermap-highways-network-fundamentals/os-mastermap-highways-network-playbook/creating-a-map-of-winter-gritting-routes.md).

# Creating a Map of Winter Gritting Routes

* Special designations contains references to which streets are gritted.
* This information can be displayed against either the street geometry or road link.

## Use cases

* Understanding which is the best route to use in winter avoiding untreated roads where possible
  * Emervency services
  * Logistics

### What You Will Need:

#### **Data**

* Roads Specification
* Roadlink
* Street
* StreetNetworkRef
* RAMI Specification
* SpecialDesingation\_Area
* SpecialDesingation\_Line
* SpecialDesingation\_Point
* SpecialDesingation\_NoGeom

#### **Software**

* Translation software is required to convert data from GML into chosen format. FME workbenches are available on GitHub to help with this.
* Data storage – once translated the data will need to be stored in a format compatible with your systems, this may be on your file system as a shape file, geopackage or tab file or in a database.
* GIS or web application to manipulate and display your results.

## Steps to Success: Connecting to Address Data

1. Information on Gritting routes is held in the Special Designation tables. This can be viewed with a simple query for example:

```
 SELECT networkref, designation, description FROM highways_nov.specialdesignation_area where designation LIKE '%Winter%’
```

2. However as Special Designation is split into 4 tables depending on geometry type. The results can be merged into 1 table by querying all 4 with UNION ALL and dropping the geometry from the query output.
3. If you are working with a large data set it may be easier to create a new table of the results. (CREATE TABLE AS…)
4. The results can be linked using USRN to the Street table and use the geometry to display.
5. However you may want to add these to RoadLink as this includes classifications as well as road name and number.
6. This can be achieved by linking the USRN using the StreetNetworkRef table containing TOIDS:

```
SELECT * FROM highways_nov.winter AS w, highways_nov.streetnetworkref AS r WHERE w.networkref = r.usrn;
```

7. Use the TOID to then join the data to RoadLink, the example limits the information returned:

```
SELECT w.designation, w.description, r.toid, r.roadclassification, r.formofway, r.geom FROM highways_nov.winter_toids AS w, highways_nov.roadlink AS r WHERE w.roadlink_toid = r.toid;
```

8. The output can then be displayed on a map or used as part of routable network to add a priority to roads that have been treated.

<figure><img src="/files/y146m9b9AMT4rLkdLluj" alt="SQL routing data output from address data"><figcaption><p>SQL query output from address data</p></figcaption></figure>

## Tips for Success: Cleaning Geometry Created with FME

* When FME writes to some databases it writes the geometry as geometry and not point, line or area.
* This creates a problem for some software reading the metadata as it does not fully understand the data type.
* This can be resolved by cleaning the metadata table – In PostGIS use: SELECT Populate\_Geometry\_Columns()
* Or by pre-creating the table and in the FME writer set table handling to either ‘Use Existing’ or ‘Create If Needed’.
* An SQL script can be used within FME to create the table if necessary


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.os.uk/os-downloads/products/transport-network-portfolio/os-mastermap-highways-network-fundamentals/os-mastermap-highways-network-playbook/creating-a-map-of-winter-gritting-routes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
