Archive for the ‘Google’ Category

Google Maps API UK Postcode Geocoding

9

Mar
16

After recently delving in to the depths of the Google Maps API I found one real problem.  It appears that the API does not provide Geocoding for UK postcodes.  This is due to license issues, as The Post Office and Ordnance Survey own the copyright for this data and therefore a fee is required to obtain it.

In search of the solution

Having crawled the internet for a good while a came across the following article Emad Fanous.  This article details an API that has been developed to return geocoded addresses, postcodes etc.

This solution provided everything I required, does exactly what it says on the tin and is easy to implement to boot.  Now I did come across postcode lists like jibble for example, however, I felt that the API would provide a more complete solution (In the sense of data available) and was more interesting to use :-) .

the code

The code is very simple and is as follows:

function gmap_geocode_postcode(postcode){
  var s = document.createElement(‘script’);
  s.src = ‘http://geo.localsearchmaps.com/?cb=gmap_map_postcode&use=google2&country=uk&zip=’ + postcode;
  s.type = ‘text/javascript’;
  document.getElementsByTagName(‘head’)[0].appendChild(s);
}

function gmap_map_postcode(lon, lat){
  map.setCenter(new GLatLng(lon, lat), 13);
}

Here’s an example of the Geocoding for UK postcodes in action.

scalability

Now I wouldn’t say this solution will be massively scaleable, however, if you just require a simple address search and you do not believe it will be heavily used then this would be a good solution for you.

update

I have recently stumbled upon a payed for service called iShareMaps on Demand.  The service (for a small fee of around £423 a year) offers a scalable UK Geocoding service that may be usefull if anyone wishes to use geocoding on a high traffic site.

Google maps adds Traffic Flow

1

Mar
02

I have just found a very usefull article on Google and their latest bult on to Google maps. It would seem they have added a Traffic Flow layer in the UI displaying flow reports.

This is another nice touch and undoubtedly adding to Googles world domination plans (if only in a very small way), however, it is still a worth while look.

See the full article here: