UK Postcode Database and Calculating Distances Between Postcodes
20:04.12 - Wednesday 15th February 2006 (Link to This Entry)
Looking over the website counter area I've noticed an increasing number of people are searching for information on how to calculate the distance between two postcodes. My original post on the matter sent people off in the direction of jibble.org but I've had at least one person mention that the uk postcode database isn't available anymore.
For that reason I've uploaded the UK Postcode Database (with grid references) to my NTL space, here:Have a look at the page on jibble (link above) for further information.
Original Post
- Currently I am mucking about with postcodes, converting them to coordinates that I can plonk onto a map of the UK, and maybe thereafter use to calculate straight-line distances between two codes. Lucky for me (yay me!) I found a free, plain-text database on jibble.org that already had the coords as metres - saving me 90% of the work I originally envisaged converting Grid References.
I'm plonking them into a simple MySQL table at the mo, then I'll be able to get the positions by searching on the first half of someone's postcode. It's not accurate down to street level but it's fine for someone looking the length of the country. The next stage will be to write a function that takes into account the size of my bitmap image of the UK, complete with various pixel offsets, and returns an X or Y position in pixels representing the location of that postcode. I don't forsee any problems.
