I've seen a lot of website that have a feature to work out the distance between two UK postcodes. (For example on an estate agency website, you can search for houses within 50 miles of a certain postcode).
I imagine this works by having every UK postcode is stored in a database with a grid reference, and working out the distance 'as the crow flies' between the two grid reference points.
Does anyone know of anywhere that I could get hold of such a database? Also, can anyone advise on a function for working out the distance between two grid reference points?
Distances between UK postcodes
Moderator: General Moderators
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
Working out the distance is actually the easy part - it's a simple triangulation. The problem is getting the post codes in the first place - most of the large sites will subscribe to the Royal Mail Postcode Index, where they are issued complete and accurate listings with regular updates in a format they can import to their databases, etc.
Be warned - this is VERY expensive
Be warned - this is VERY expensive