How to create a choropleth (fill) map using ONS geographies
Last updated
Was this helpful?
Last updated
Was this helpful?
It’s easy to create a choropleth (or fill map) using ONS geographies (LSOAs, wards, etc.) in the OS visual, without requiring a separate geometry file.
To make the following steps work, your data will need a column that includes an ONS Government Statistical Service code (GSS).
GSS codes are 9-character alpha-numeric codes which correspond to geographies that ONS support. E.g. An LSOA code looks like - E01000917
Examples of LSOA codes are shown in the table below:
E01000916
Camden 027B
E01000917
Camden 027C
E01000917
Camden 027C
E01000914
Camden 028B
To display these geographies as polygons on a map, simply drag and drop the column of data that has these codes into the Features Layer: GSS identifiers for the geocoding field of the visual.
Any incorrect codes won’t display a polygon on the map. The notification panel will display what codes did not work. Currently, the visual does NOT support historic codes.
To colour the map and create the choropleth, drag the relevant column of data into the Features Layer: Colour field. This field can accept either numeric or text data. It’s important that within your data table, every row has a GSS code (representing the polygon) and the relevant data to colour the polygon (numeric or text).
If using numeric data then the Features Layer: Colour field allows several mathematical operations to be performed on the data (e.g. Sum, Average, Count etc.) to interpret the data. These may need to be utilised to display the desired data correctly on the map.
It’s quite common that a report reader will want to view a defined geography (for example, a local authority such as Cardiff) but see data on the map that represents an underlying geography, such as wards. To do this, it’s important that the underlying data is structured in the correct way. Each row should have both the geography to be displayed on the map (for example, ONS ward code - W05001272) and the geography to filter by (the local authority that the ward code belongs to, in this case, Cardiff). The data might look like the following table:
Trowbridge
W05001296
7 009
Cardiff
whitchurch and tongwynlais
W05001297
6 832
Cardiff
allt-yr-yn
W05001627
3 989
Newport
Alway
W05001628
3 403
Newport
A filter can then be created to display the data, such as having a table listing the local authorities alongside the map. When a user clicks a local authority, the relevant wards and any associated data making up that local authority will be displayed on the map.
Once appropriate data has been dragged into the Features Layer: Colour field then the map’s colours should update. To customise these colours, go into the Format Visual > Styling: Features Layer section.
If using text data to colour the map then a maximum of 12 colours will be automatically generated. These colours cannot be manually changed.
By changing the Min or Max Feature Colours, the map colours will update based on the minimum and maximum values of the data used. Opacity can also be altered to style the map.
The Feature % Clip can be used to ignore outlier data points. It ignores the selected % minimum and maximum data points in the data. As an example: if 5% is specified, then the minimum 5% and maximum 5% of data points will be ignored when colouring the map.