My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 9683: Reverse geocoding in remote locations returns a result in Japan
24 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----


Sign in to add a comment
 
Reported by [email protected], May 4, 2016
https://maps.googleapis.com/maps/api/geocode/json?latlng=41.64162358865791,-8.787144720554352

using this coordinates, api gives me japan localization on first formatted address when this coordinates belong to Portugal, and in fact, the next results in response are about the correct localization
May 4, 2016
#1 [email protected]
I'm getting the same for most, if not quite all, geocode requests. The address that comes up is:  1 Chome-11 Kamifukubara, Yonago-shi, Tottori-ken 683-0004, Japan

ALso mentioned here: http://stackoverflow.com/questions/37028442/wrong-google-maps-distancematrix-behaviour
May 4, 2016
#2 [email protected]
As a quick workaround I've changed Google's example code ( https://developers.google.com/maps/documentation/javascript/geocoding#reverse-geocoding-by-location ) from using results[1] to results[0] and this seems to work for now.
May 4, 2016
Project Member #3 [email protected]
(No comment was entered for this change.)
Status: Accepted
Labels: ApiType-Geocoder Type-Defect Internal-28574495
May 4, 2016
Project Member #4 [email protected]
 Issue 9682  has been merged into this issue.
May 4, 2016
Project Member #5 [email protected]
 Issue 9684  has been merged into this issue.
May 4, 2016
Project Member #6 [email protected]
 Issue 9685  has been merged into this issue.
May 4, 2016
Project Member #7 [email protected]
 Issue 9688  has been merged into this issue.
May 4, 2016
Project Member #8 [email protected]
Thank you for reporting this, already 4 other reports in this issue tracker, I'm picking this one because it has most comments.

There is an issue in the Geocoding API, whereby reverse geocoding a latlng that is far away from precise results will often produce a sublocality_level_3 result in Japan. We are working on a fix.

The best solution is to never depend on the ordering of reverse geocoding results.

It is highly recommended to always inspect the "types" array of results before using them.
Each use case of reverse geocoding will generally require results of a limited set of types, e.g. ["premise", "street_address", "route"] when looking for street-level addresses.

Applications that already implement this strategy will not be affected by the current issue.

While reverse geocoding results are generally ordered from more to less precise, this ordering is not guaranteed there may be exceptions. Relying on any specific ordering of results is risky and highly discouraged.

Alternatively, restricting reverse geocoding results via the result_type or location_type paramters can also be used to workaround the current issue:

https://maps.googleapis.com/maps/api/geocode/json?&latlng=0,0&result_type=street_address&key=YOUR_API_KEY
https://maps.googleapis.com/maps/api/geocode/json?&latlng=0,0&result_type=route&key=YOUR_API_KEY

https://maps.googleapis.com/maps/api/geocode/json?&latlng=0,0&location_type=ROOFTOP&key=YOUR_API_KEY
https://maps.googleapis.com/maps/api/geocode/json?&latlng=0,0&location_type=RANGE_INTERPOLATED&key=YOUR_API_KEY
https://maps.googleapis.com/maps/api/geocode/json?&latlng=0,0&location_type=ROOFTOP|RANGE_INTERPOLATED&key=YOUR_API_KEY

This workaround may be easier to implement in some cases, but in no case replaces a proper strategy to never depend on the ordering of reverse geocoding results.

To learn more about these restricts, please see
https://developers.google.com/maps/documentation/geocoding/intro#reverse-restricted
Summary: Reverse geocoding in remote locations returns a result in Japan (was: Incorrect geocode information)
May 4, 2016
#9 [email protected]
I guess this result comes up because the bounds for this location include the whole world:

"formatted_address" : "1 Chome-11 Kamifukubara, Yonago-shi, Tottori-ken 683-0004, Japan",
         "geometry" : {
            "bounds" : {
               "northeast" : {
                  "lat" : 90,
                  "lng" : 180
               },
               "southwest" : {
                  "lat" : -90,
                  "lng" : -180
               }
            },

Maybe it should somehow be prevented that locations with bounds like this can ever be inserted...
May 5, 2016
#14 [email protected]
now I'm getting correct location address. don't know what the issue
May 5, 2016
Project Member #15 [email protected]
 Issue 9687  has been merged into this issue.
May 5, 2016
Project Member #16 [email protected]
 Issue 9693  has been merged into this issue.
May 5, 2016
Project Member #17 [email protected]
 Issue 9698  has been merged into this issue.
May 5, 2016
#18 [email protected]
I got this as a result in Asus' weather widget and was pretty confused about it :-)
May 6, 2016
Project Member #19 [email protected]
 Issue 9707  has been merged into this issue.
May 12, 2016
#20 [email protected]
ETA for this defect? or fixed already? we have similar issue reported coincidentally for the same date as mentioned in issue 9683.
Sign in to add a comment

Powered by Google Project Hosting