Thursday, October 23, 2008

Reverse Geocoding With Google Maps

Google have added reverse geocoding to the Google Maps API.

Geocoding is the process of converting an address into a latitude and longitude. For example, the White House has the postal address 1600 Pennsylvania Avenue, Washington, D.C., USA. But if I want to map the White House I need to know what its latitude and longitude are (38.89767,-77.03655). If I am making a map with the Google Maps API I can use either the HTTP Geocoding service for server-side geocoding or the GClientGeocoder class for client-side geocoding.

Reverse Geocoding
Reverse Geocoding is, not surprisingly, the reverse of geocoding. Instead of converting an address into a latitude and longitude it is the process of converting the latitude and longitude into an address. For example, if I was given the co-ordinates '38.89767,-77.03655' a reverse geocoder would be able to convert that into the address for the White House. To find out more read through the reference and sample code.

Examples of Reverse Geocoding
Google have created a very simple example map showing the new reverse geocoder in action. If you click on this example map the reverse geocoder will convert the latitude and longitude into a postal address.

MeetWays map
MeetWays allow users to find a point of interest between two addresses. Let's say you need to meet a friend or client for lunch on the other side of town. ways will allow you to enter both addresses and the type of restaurant you are looking for and give you the exact halfway point and a list of restaurants in that area.

Using Google Maps' geocoder MeetWays can find the latitude and longitude of the two addresses the user enters and work out the latitude and longitude that is the halfway point. MeetWays then uses the reverse geocoder to convert that latitude and longitude into an address. MeetWays can then find the points of interest you have chosen around that address (in the screen shot above MeetWays has found the Pizza restaurants halfway between my house and a friend's house).

Reverse Geocoding Game

Pamela Fox, of the Google Maps team, has also created a nice game that utilises the new reverse geocoder. In the game players have one minute to pinpoint on a map as many postal addresses as they can.

The game gives the player an address and the player then has to click on the map where they think that address is. The reverse geocoder is then used to work out the postal address of the point clicked and points are awarded based on how close the guess was.

Via: Google Geo Developers Blog: Geocoding... in Reverse!

Location Marker Editing
It is also now possible to edit location markers outside of the USA. When you search for a location in Google Maps the results are shown on the map with a red marker. Sometimes the red marker is not positioned in exactly the correct location. If you are logged into a Google account you can now drag the marker to the correct location.

This feature has been available in the USA for a while but I think it has not been available outside the US until now. I'm pleased to say I have just corrected the marker for my home address in London.

Via: Mapperz

Post a Comment