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 }
You did a great great job. Thanks for sharing us.
Thank you mauricio
You must log in to post a comment.