Going back a few years I downloaded a UK postcode database that mapped Outcodes (the first part of the postcode) to approximate Lat/Long co-ordinates.  When used correctly you could use the data to find which postcodes were closest (distance matching) or simply the distance between two places by comparing the Lat/Long co-ordinates with a bit of maths.  The main drawback was the need for a database that was only accurate to within a few km – no good for showing actual locations on a map or for local services – as the co-ordinates returned were for the centre of the Outcode.

Nowadays however Google’s geocoding service allow you to calculate distances between two addresses or postcodes effortlessly.  You can then plot these directly onto a Google map and best of all, it’s all free to use.

My latest project provided an opportunity to make use of this facility.  I had initially intended to use UpMyStreet or Google Local Search to furnish the information my client needed.  Upon inspection however, neither service had a comprehensive enough list of local services.

The decision was made to go back a step and manually enter what the client deemed the most important local landmarks or services.   This was done simply by providing a postcode or partial address and from this I was able to provide the distance to the service and plot it on a map.

There are many useful applications for this and I’ll be adding some of these facilities to this website over the next few weeks I hope.  As I add facilities I’ll be sure to add source code to demonstrate how simple these operations have now become.

If you enjoyed this post, make sure you subscribe to my RSS feed!