Search code examples
androidgoogle-mapsgoogle-maps-android-api-2google-geocoder

Geocoder returns multiple addresses


In Android's Geocoder, method getFromLocation can return more than one address for a given lat long. But lat long uniquely represents a location on earth surface, so why does it return multiple objects?


Solution

  • Reverse geocoding translates latitude, longitude into a human-readable address. However, there are different objects that you may be interested in. For example, you can search the nearest street address, the nearest postal code, the neighborhood, the city, etc. For this reason reverse geocoder returns more than one result.

    Please look at this example in the Geocoder tool.

    As you can see the first result has a type street_address, the second result has a type bus_station, the third has a type neighborhood, and so on until the country level.

    Hope my answer addresses your doubts.