Geocoding and Reverse Geocoding in Android

by Krishnaraj Varma on July 4, 2010

Download source code of the article.

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.

{ 9 comments… read them below or add one }

mauricio August 15, 2010 at 7:19 pm

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

Reply

Krishnaraj Varma August 16, 2010 at 6:39 am

Thank you mauricio :)

Reply

mauricio August 15, 2010 at 7:19 pm

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

Reply

Krishnaraj Varma August 16, 2010 at 6:39 am

Thank you mauricio :)

Reply

mauricio August 16, 2010 at 12:49 am

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

Reply

Krishnaraj Varma August 16, 2010 at 12:09 pm

Thank you mauricio :)

Reply

mauricio August 16, 2010 at 12:49 am

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

Reply

Krishnaraj Varma August 16, 2010 at 12:09 pm

Thank you mauricio :)

Reply

Balkis Abid July 29, 2011 at 1:05 pm

Hi please can some one explain to me what this application can do.
i’m developping an geolocalization application and i’d like to get item on the map by its adress,
can some one help me please
Thank you

Reply

Leave a Comment

 

Previous post:

Next post: