Unless your data comes pre geo-encoded, if you’re trying to do some UK-based geospatial analysis you’ll probably need some easy way of translating addresses into latitude/longitude pairs or some similar co-ordinate system.
Whilst full-address geocoders are available, if you don’t actually need that level of precision then looking up a full postcode is often good enough and far faster (note to US readers: UK postcodes are way more precise than US zipcode – BPH Postcodes quotes an average of about 15 properties per postcode)
A few years ago this data could be a little challenging to obtain – for free anyway. But now there are various sources offering that up sans charge in various formats and levels of up-to-dateness; some more useful than others
My current favourite is probably Doogal. There, Chris Bell has provided all sorts of address-based tools there. Need to generate a random postcode or calculate the elevation of any route? He has it all.
Most interesting to me are the big CSVs of the UK’s postcodes, past and present, obtainable by pressing “download” at the top right of this page.
It’s full postcode to long/lat mapping and includes the below columns too, which allow for some very useful groupings or lookups.
- In Use?
- Built up area
- Built up sub-division
- Lower layer super output area
From his blog and various appreciative comments, it sounds like it’s kept up to date nice and regularly, which is truly a service to mankind.
If you have any problems with his file, then some other alternatives would include the free version of Codepoint Open (although it seems to show Eastings/Northings rather than long/lat – although it is possible to convert between the two), or a UK-Postcode API.
All this is overkill if you just have <100 such lookups to make – you can find many web-based batch converters that’ll do the job for you very quickly, and often to address-level accuracy, if you don’t have too many to do. Doogal’s is here.