开发者

Need to find latitude and longitude of postcodes and store into my database [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

开发者_开发百科 Improve this question

I’ve got a database full of UK Postcodes, now I’d like to be able to store the latitude and longitude of these specific postcodes along with the record with the database. Is there any way that I can obtain this data free without violating any T&C's?

I know I could do this using Google maps API for each postcode, but I have way over 20,000 postcodes in this database and to get the lat and lng for each of these postcodes each time is not an option really.

Thanks in advance, M


Postcode location data is available free now. See this answer:

  • https://stackoverflow.com/a/2625123/587803

https://www.ordnancesurvey.co.uk/opendatadownload/products.html

The one you want is "Code-Point open".


Here it is. Dumped SQL table full of Postcodes, LAT/LON, X/Y coordinates :)

Download zip (UK-Postcodes.zip) and for more info read [same-website]/guides/article.php?article=64 :)

I haven't tested it, but it should be working, lad :)

Happy coding ^^


Maybe Nominatim should do the trick. The only problem is that it might not be up to date.


Geonames.org offers a free downloadable database. You could try Bing API or other commercial offerings but they have rather restrictive T&C in how many queries you can make within a time period, how you can use it (needs a lawyer to interpret their nuances).

I found Geonames.org to be more than sufficient for my needs.


For postcode database, unfortunately I cannot help you.

But for Google... You know, you don't have to do this for EVERY postcode EACH time. You can cache the values in your database and do it only once for each new postcode. Although this will take some time, it's possible.

Yeah, it still sucks. But better than nothing.


http://www.freethepostcode.org/ provides information you may find useful.


I've only seen this done from a local database with commercial software, possibly because of the licensing restrictions the Royal Mail put on their postcode data.

There are APIs with reasonably high rate limits that can geocode UK postcodes, though. Yahoo's geocoding API is restricted to 5,000 hits a day, but that means you could have your entire database done in four days, store the lat/lon in the database, and just use it to add new addresses as they come in, say.

Also -- how accurate do you need the information? If you just need a rough location, you could geocode to the Outbound (e.g. "BS1"); I've seen user-sourced databases of at least arguable legality around the net for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜