Reputation: 14404
I'm using Reverse Geocoding service and I get "ZERO_RESULTS". In my PHP scripts I created the following function:
public static function getJsonData($lat, $lng, $apikey) {
$url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=".$lat.",".$lng."&language=en-EN&key=". $apikey;
$json = file_get_contents($url, FALSE, self::_createContext());
return $json;
}
Here is a list of some of GPS coordinates for which I get no results:
I also tried to submit the coordinates on this page: https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse, but I get the following alert error:
Geocoder failed due to: ZERO_RESULTS.
If I try to search for the same coordinates on Google Maps, it works, it find the related places on the map, with no troubles:
So, why Reverse Geocoding fails?
EDIT:
I used the same coordinates with MapQuest reverse geocoding API and it works. I get the following countries:
Why does MapQuest API work with disputed areas?
Upvotes: 1
Views: 1415
Reputation: 32148
Have a look at the first coordinate in your examples in geocoder tool:
https://google-developers.appspot.com/maps/documentation/utils/geocoder/#q%3D31.71255%252C35.22438
The 31.71255,35.22438 is located in the West Bank area. West Bank is the disputed area and this is a known issue for Google reverse geocoder. All coordinates in disputed areas return ZERO_RESULTS.
There is a bug for this in the public issue tracker:
https://issuetracker.google.com/issues/35826813
Feel free to star the bug to add your vote and hopefully Google will solve it soon.
All these territories are disputed areas:
https://en.wikipedia.org/wiki/List_of_territorial_disputes
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.
Upvotes: 4
Reputation: 107
Looking at Cyprus in Google Maps, it looks like they do not have data in this region, hence the lack of response.
I would look into other rgeo services if you need this area. Perhaps look into Skyhook, Baidu, or Mapquest.
Upvotes: 0