views:

424

answers:

6

Hey guys, Ive 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 anyway 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

A: 

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

npinti
A: 

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.

Mikos
AFAIK Google Maps API doesn't allow commercial use.
Mikos
http://download.geonames.org/export/dump/ Which one is for the UK?
phpNutt
GB, I would guess.
Mikos
A: 

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.

Tomasz Struczyński
A: 

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

AakashM
A: 

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.

Matt Gibson
A: 

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 ^^

Nikola