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:
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,
You could take a look at Google's Geocoding API, specifically Reverse Geocoding.
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.
来源:https://stackoverflow.com/questions/7994913/generate-uk-postcode-from-lat-lon-search-in-google-maps