You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/manual/incorrect-postcode-data.html.md
+23-12Lines changed: 23 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,36 +6,47 @@ layout: manual_layout
6
6
section: Applications
7
7
---
8
8
9
-
We get our postcode data from Locations API, which uses OS Places API (Ordnance Survey) under the hood. Locations API postcodes [keep themselves up to date automatically](https://github.com/alphagov/locations-api/blob/main/docs/postcodes-added-cached-updated.md#how-postcodes-are-updated) and should never be more than about a week out of date.
9
+
We get our postcode data from Locations API, which uses OS Places API (Ordnance Survey) and the ONS Postcode Directory (Office for National Statistics) under the hood:
10
+
11
+
- OS Places Api: This is a detailed dataset, including individual addresses, local custodian codes (ie mapping to councils), and supports split postcodes. These records [keep themselves up to date automatically](https://github.com/alphagov/locations-api/blob/main/docs/postcodes-added-cached-updated.md#how-postcodes-are-updated) and should never be more than about a week out of date
12
+
- ONS Postcode Directory: This is a less detailed data set, which cannot map to a council (it only has a lat/long for postcodes), but also includes retired postcodes and large user postcodes. These records are [downloaded by an automated task](https://github.com/alphagov/locations-api/blob/main/docs/updating-ons-postcode-data.md) when an update is spotted in their RSS feed. It's refreshed roughly 2-3 times a year.
10
13
11
14
In case the data is incorrect, a first step would be checking the Locations API result with the OS Places API result.
# The information we currently have in Locations API
28
26
Postcode.find_by(postcode:"E18QS").results
29
27
```
30
28
31
-
If the results are not the same (especially the Local Custodian Code), then either the user happens to have looked up the postcode in the exact week where it has been updated by OS Places API but we haven't updated our cache yet, or - more likely - our mechanism for self-updating postcodes has broken, and requires further investigation.
29
+
### If OS Places API returns results
30
+
31
+
If the results are not the same (especially the Local Custodian Codes in the addresses), then either the user happens to have looked up the postcode in the exact week where it has been updated by OS Places API but we haven't updated our cache yet, or - more likely - our mechanism for self-updating postcodes has broken, and requires further investigation.
32
32
33
33
This is how you can manually force Locations API to update its cache for a given postcode:
### If OS Places API doesn't results, but there is a record
43
+
44
+
This is likely a case in which the returned results are from the ONS Postcode Directory. This is a lower-quality set of data for our purposes (it doesn't contain Local Custodian Codes, so can't be used for postcode matchers that need to find a council). You can check if the postcode is indeed an ONSPD record, and if so if it's retired or a Large User Postcode like this:
0 commit comments