Geocoding and Reverse Geocoding in Android

by Krishnaraj Varma on July 4, 2010

in Android

Download Geocoder Sample (121)

Geocoding is the process of finding geographic location from location name, zip codes, etc… Reverse Geocoding is the process of finding location name and other information from geographic location. In Android there is a class Geocoder which handles Geocoding and Reverse Geocoding. This class has three methods: getFromLocation, getFromLocationName and a variant of getFromLocationName.

The method getFromLocation is used to reverse geocode and the method getFromLocationName is used to geocode. The getFromLocation method accepts 3 parameters: latitude, longitude and maximum number of results to return.

There are 2 variants of the method getFromLocationName. Both accept location name and maximum number of results to return. The first variant accepts additional four parameters. These are the longitude and latitude of the bounding rectangle for the search results. If you specify these parameters, the Geocoder will only search within the bounding rectangle, i.e. the results outside the bounding rectangle will not be included in the results.

These functions return a list of Address class which represents the result of the query.

The sample provided is a simple one to demonstrate the use of this class, hope this will help you to start geocoding.

{ 2 comments… read them below or add one }

mauricio August 16, 2010 at 12:49 am

You did a great great job. Thanks for sharing us.

Krishnaraj Varma August 16, 2010 at 12:09 pm

Thank you mauricio :)

Previous post:

Next post:

Disclaimer: This is a personal weblog. The information in this weblog is provided “AS IS” with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.