Google Geocoding stopped to work for Crimea, Ukraine

倖福魔咒の 提交于 2019-11-27 01:40:01

问题


I've discovered very strange issue. Geocoding API suddenly stopped to work for Crimea coordinates. Example: Simferopol city:

http://maps.googleapis.com/maps/api/geocode/json?language=en&latlng=44.957844%2C34.104996&sensor=false

But it works for any other place in Ukraine and Russia. Example: Kiev, Ukraine

http://maps.googleapis.com/maps/api/geocode/json?language=en&latlng=50.463405%2C30.481567&sensor=false

Recently the API worked properly. Please tell, is it the Google restriction due to political events in Ukraine? Should the service work again, and when? Our application critically depends on user's geocoded location, and this issue blocks the workflow.

Thanks a lot!


回答1:


Yes, it's a restriction due to political events. I got this answer from Google Support:

Since Crimea currently is a disputed territory (http://en.wikipedia.org/wiki/List_of_territorial_disputes), Geocoder results will currently not return results for reverse geocoding.




回答2:


Google (reverse) geocoding service stopped working for Crimea due to territorial dispute.

A not-trivial, but future-proof technical solution is to create an abstraction API over geocoding services rather than using a specific service directly in your app.

This way you reduce dependency on a specific service. For example, you can use Yandex geocoding service if the coordinates are within the bounding rectangle of Crimea:
http://geocode-maps.yandex.ru/1.x/?geocode=34.104996,44.957844&lang=en-US

Another benefit of an abstraction level is that you may very quickly switch to a different service if your "main" service goes down (for whatever reason).


Please note that support of certain regions or countries by a software product may be subject to US / EU sanctions. Support of any region with a territorial dispute is a potential problem.




回答3:


Good news. As of January 2019 Google resolved an issue with ZERO_RESULTS in disputed areas.

You can see that now they return results, but country name doesn't appear in responses. This aligns with approach that they had in forward geocoder. Disputed areas don't have country names.

The following request now returns Simferopol

https://maps.googleapis.com/maps/api/geocode/json?latlng=44.957844%2C34.104996&key=YOUR_API_KEY

The same result in geocoder tool:

https://google-developers.appspot.com/maps/documentation/utils/geocoder/#q%3D44.957844%252C34.104996

I hope this helps!



来源:https://stackoverflow.com/questions/23214989/google-geocoding-stopped-to-work-for-crimea-ukraine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!