As part of my project to create a mobile polling station locator site, I’ve been playing with various mapping APIs.
As a base experiment, I passed the postcode of a polling station (GU22 7DT) to both Google Maps and Yahoo Maps. Here are the results.
Two things of interest to note.
Firstly, Google has a specific “Mobile” call in the API, it reformats the map image to be more readable on the mobile – I think you’ll agree that Google edges out Yahoo here.
Secondly, Google maps is less accurate than Yahoo! Maps. Severely so. While maps.google.com is highly accurate when passed a postcode, the API seems only to look at the first part and discard the rest. Yahoo on the other hand is unnervingly precise.
What to do? Well, as all the cool kids are doing, let’s have ourselves a mashup!
We can call Yahoo Maps to get the Latitude and Longitude of a postcode thusly
This will return
<City>Woking, GU22 7DT</City>
We take the Latitude and Longitude and pass it to Google Maps like so
Which nets us this map.
Hey presto! Better looking than the Yahoo Map and better accuracy than the Google Map.
The geocoding prescision of the Google Maps API is very poor for UK postcodes. There really shouldn’t need to be this need sort of work around.
I am now using Ernest Marples’ Postcode Latitude/Longitude Lookup API which has much greater accuracy than either Google or Yahoo.