1

I'm trying to generate a UK postcode from a latitude and longitude search in Google Maps. For example, a search for 57.350237,-1.977539 in Google Maps returns this:

https://i.stack.imgur.com/mSULM.png

I want to be able to extract that postcode - AB41 8.

All I've seen so far are ideas on how to get the lat,lon from the postcode but not the other way around. Any ideas?

Thanks,

KerrM
  • 5,139
  • 3
  • 35
  • 60

2 Answers2

3

You could take a look at Google's Geocoding API, specifically Reverse Geocoding.

LukeH
  • 263,068
  • 57
  • 365
  • 409
0

Unfortunately in the UK, the Royal Mail are the only ones with such data of that accuracy and completeness.

To access it, you have to pay them for a copy of their Postcode Address File.

Widor
  • 13,003
  • 7
  • 42
  • 64
  • How about the Ordnance Survey's [Code-Point Open](http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/index.html) data? It doesn't contain full address data like the PAF, but it does contain a mapping between postcodes and latitudes/longitudes, as the OP requires. – LukeH Nov 03 '11 at 23:07
  • @LukeH Good spot, interesting. You're right, that would be adequate for OP's needs. – Widor Nov 03 '11 at 23:11
  • Thanks for the input there. I'll explore that possibility too. – KerrM Nov 04 '11 at 09:22