Kash
Kash

Reputation: 31

Google Geocode api returning incorrect result for a particular address

When I try to geocode one of the adress using Google geocode api, Google api returns an incorrect location.

search address : republic of estonia

result from google api: spain

I am using javascript Google api to geocode the address. For some other location the result is correct but for above address its incorrect.

If we enter below url in browser, we get the JSON back and it is showing result somewhere in Spain rather than showing result in Estonia.

http://maps.googleapis.com/maps/api/geocode/json?address=republic%20of%20estonia

I tried same addres in maps.google.com and it takes me to correct location.

Upvotes: 3

Views: 1153

Answers (2)

Joseph Hansen
Joseph Hansen

Reputation: 13329

Google assumed you were looking for "Calle Estonia" or "Estonia Street".

You should request that Google add "Republic of Estonia" to their list of spaces. Google, and most other mapping services, only have "Estonia" or "EST" in their list of places.


Also, you may want to use a different API if you need to get an accurate answer. Google is really good, but Google tries to "guess" what you mean and always gives you a result. But, a service like SmartyStreets matches searches to databases of addresses (so if the search is not a "real" place, it will tell you).

(Full disclosure: I have worked for SmartyStreets.)

Upvotes: 1

xomena
xomena

Reputation: 32198

Have a look at the Estonia country feature in Map Maker:

https://www.google.com/mapmaker?iwloc=0_0&fmi=0_0&gw=39&fid=5085290329182063613:4677726785527621059&dtab=overview&ll=58.620408,24.93212&spn=3.101226,8.668213&z=7&lyt=large_map_v3&htll=58.560236,25.449737&hyaw=278.7642140009582

If you check the list of names for this feature, you will see that there is no 'Republic of Estonia' in the list. The name is simply 'Estonia'.

The request for 'Estonia' works as expected:

https://maps.googleapis.com/maps/api/geocode/json?address=estonia&key=YOUR_API_KEY

If you believe that 'Republic of Estonia' must be in the list of the names please Send a feedback (bottom right corner) to Google from this page

https://www.google.com/maps/place/Estonia/@58.7223142,23.1414399,7z/data=!4m5!3m4!1s0x4692949c82a04bfd:0x40ea9fba4fb425c3!8m2!3d58.595272!4d25.013607?hl=en

Upvotes: 2

Related Questions