Geocoding and Reverse Geocoding in Android

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.

Comments

  1. mauricio says:

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

  2. mauricio says:

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

  3. mauricio says:

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

  4. mauricio says:

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

  5. Balkis Abid says:

    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

  6. Ashish Kamath says:

    Hey Krishnaraj i wanted to ask I am currently working on a project which is similar to Google Maps. I’m having a problem. My problem is I’ve got all the addresses that i need 2 pin point..but how do i convert it to lat and long. wil tis code help me ?
    Wil it help me to pin point the locations ? Moreover i have a huge database. So how do i store latitude and longitude of every location ? Plz help me its my final year project..:(

Speak Your Mind

*