1

guys. Method getFromLocationName(..) in Geocoder class return Addresses by "a user-supplied description of a location". And if I'm calling it with "London" string or "Statue of Liberty" it returns addresses and I can animate the Map to found coordinates. But iI need to find latitude and longitude based on ZIP CODE. If I call method with "33040" string (zip of Key West region) - Geocoder returns some another addresses (of course!), because it can't associate this string with zip. I have made some trick: adding "usa " prefix if user enters decimal value. And it returns currect locations by string "usa 33040" and others in 70%. Is any idea how to find location by ZIP in 100% cases? Thanks!

Igor
  • 173
  • 1
  • 1
  • 9

1 Answers1

4

Have you tried strings like "33040, United States"? That format certainly works in Google Maps, so it may work on Android, though the Android geocoder is not as good as that Google Maps uses.

Ollie C
  • 28,313
  • 34
  • 134
  • 217
  • In general, if you want to geocode a zipcode, add the country name to the query. 5-digit zip codes are valid in many countries and some specific ones will be valid in several countries at the same time. – miguev Feb 06 '12 at 21:07