Creating a tool to understand Channel Islands postcode data

At British Red Cross (BRC), we work a lot with postcode data. While using a postcode to locate something has its limitations, a full postcode can still give a fairly specific location and is something that most people will recognise or be able to find out easily (as opposed to other types of location data, say, a latitude and longitude, Unique Property Reference Number or pluscode).

Most of the time when we want to find out what location a UK postcode refers to, we can compare it to the Office for National Statistics’ comprehensive Postcode Directory which, among other things, gives precise coordinates for every postcode in the UK.

BRC operates in areas of the British Isles that are not part of the UK, specifically the Crown Dependencies of the Channel Islands and Isle of Man. When we work in these areas, we still collect postcodes in response data but it is harder to identify the locations these refer to as the postcodes for these areas don’t have coordinates assigned in the ONS Postcode Directory (or reliably in any other similar service to which BRC has access). This makes it hard to use the data to understand where we’re working unless you have detailed local knowledge. Ideally, we’d be able to look at the data for the Crown Dependencies at the same time as the data for the rest of the UK to get a comprehensive sense of where we’re providing support.

A map showing the locations of Jersey, Guernsey and the Isle of Man in relation to the British Isles
Locations of Crown Dependencies, where postcodes are harder to match to a location

To get around this limitation, we built our own lookup table to approximately locate Channel Islands postcodes. It’s not as accurate as the ONSPD is for UK postcodes, but it gives us a better understanding of where in the Channel Islands our postcode data refers to.

This lookup table uses open data from Wikipedia to assign an estimated latitude and longitude to postcodes from the Channel Islands, which is accurate to the parish level (parishes range between 3–15km2). It is suitable for giving a rough indication of where a postcode is but wouldn’t allow us to locate specific streets or addresses.

How we made the tool

Wikipedia has a breakdown of the locations referred to by the GY and JE postcodes, which helps to narrow partial postcodes down to a parish. For example, we can see that postcodes beginning with “JE2 3..” are in Saint Helier, the capital of Jersey. Some partial postcodes are straightforward — e.g. postcodes beginning with “GY10 1..” are on the island of Sark. However, some are more complex: postcodes in the range “GY6 8..” might be in Vale or St Andrew, depending on the final two characters.

An extract of a table from Wikipedia showing which parishes postcodes refer to
Extract of the postcode areas of Jersey from Wikipedia

Taking these broad location descriptions from Wikipedia, we assigned a geographic coordinate to each partial postcode from the table. This was done manually by comparing OpenStreetMap data and satellite imagery to make an informed guess at what looked to be the population or cultural centre of each parish — e.g. the church a parish is named after, or a local government office (from OpenStreetMap), or if there was a very obvious populated area (from satellite imagery).

A side-by-side view of a satellite image of Jersey and an OpenStreetMap view of the same location
Using OpenStreetMap and satellite imagery to identify population centres on Jersey

We made a table containing the partial postcodes and their assigned geographic coordinates, and then created some regular expressions to match full postcodes to the partial postcodes we have locations for. Regular expressions are a text search algorithm that allow you to match partial text according to user-defined patterns. In this case, running a simple matching algorithm would fail, since we only have full postcodes in our data but partial postcodes to match to. Regular expressions help us get around this limitation, by matching flexibly on as much of the partial postcode as we have access to. So, for the JE2 4GG postcode, it will match in the lookup table to the regex JE2 4[A-Z][A-Z] — meaning any postcode that begins “JE2 4” with any two alphabet characters following.

A screenshot of an Excel spreadsheet showing the lookup algorithm to match postcodes to coordinates
Sample of the table that provides regular expression matches to link partial postcodes to approximate location

Using this simple table, we used Python to apply the regular expression matching to our postcode data from the Channel Islands and were able to assign rough locations to each postcode. We used Python because it integrates well with our ArcGIS Online setup, but regular expressions are widely supported and the same process could be used in Excel, PowerBI, JavaScript or SQL.

This simple tool means we now have a better idea of where in the Channel Islands BRC is working. We’ve shared the tool with other BRC teams who work with postcode data, and will be expanding the tool to work with Isle of Man postcodes as well.

If you work at British Red Cross and think these types of geospatial analysis could be useful, then please drop into our weekly surgery call and we can have an informal chat — the details are on our RedRoom page. Alternatively, if you’re in the Red Cross movement feel free to reach out to your National Society’s GIS or Information Management colleagues and look out for the Surge Information Management Support (SIMS) community of practice which includes a number of GIS specialists and reaches across borders and time zones.

--

--