Many Pies

Many Pies

Monday, March 12, 2012

Getting a list of postcodes in a parliamentary constituency

Whilst there are a few places where you can look up a single postcode and get which constituency it's in, I didn't find a single place to get a list of postcodes. Here's how I did it:

  • I got a list of postcodes and which ward they were in from here. (Also available from the Ordnance Survey.)
  • I got a list of wards and their codes from the electoral commission website.
  • Fortunately the whole constituency I wanted was in one region, i.e. the letter or two at the beginning. The reason it was fortunate is because the data is in a file per region. So I used Excel to do a vlookup from the postcode list to the ward list and filtered by those which were in the ward list.

No comments: