Google Maps Distance Matrix wrong result
Asked Answered
L

2

17

I am performing a request to the Google Maps Distance Matrix API to calculate the distance from one point to another. Both points are in Russia. The problem is that, in some cases, the API returns the wrong destination.

For example, I select this point on the Black sea coast, Russia.

The request to the API is
https://maps.googleapis.com/maps/api/distancematrix/json?origins=58.3941198,33.223535&destinations=44.58019749055891,38.0705451965332&mode=driving&language=ru-RU&key=

It returns

"destination_addresses" : [
  "1 Chome-11 Kamifukubara, Yonago-shi, Tottori-ken 683-0004, Japan"
],...

So, Google Maps knows it is Russia, but Distance Matrix thinks it is Japan. Why?

Is there a known bug for places near the sea coast?

UPDATE

This bug was handled in issue tracker https://issuetracker.google.com/issues/35828610. It was marked as Fixed on July 19, 2016.

Lubricant answered 4/5, 2016 at 12:53 Comment(2)
I'm seeing the same address "1 Chome-11 Kamifukubara, Yonago-shi, Tottori-ken 683-0004, Japan" for a LOT of (nearly all) reverse geocoding requests using geocoder.geocode from Google Maps API. I did not see the error last night so I'm guessing this is a recent bug in Google's system.Swartz
Issue in the issue trackerOngoing
A
15

Good news and bad news :)

The bad news is that the Japanese address will come up for many remote locations, as this is an on-going issue in the Geocoding API. This has been reported in the Google Maps API issue tracker: https://code.google.com/p/gmaps-api-issues/issues/detail?id=9683

Take a look at this comment on the issue tracker for details on how to workaround this.

The good news is that you still get the correct distances and route from Distance Matrix API and Directions API.

Are answered 4/5, 2016 at 13:48 Comment(0)
S
11

The problem with this Japan location is its bounds which say it is all around the 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
           }
        },
        "location" : {
           "lat" : 35.4426127,
           "lng" : 133.3638089
        },
        "location_type" : "APPROXIMATE",
        "viewport" : {
           "northeast" : {
              "lat" : 90,
              "lng" : 180
           },
           "southwest" : {
              "lat" : -90,
              "lng" : -180
           }
        }
     },
     "place_id" : "ChIJlwBC99P3VjUReuUmCg7qU_E",
     "types" : [ "sublocality_level_3", "sublocality", "political" ]
Skipp answered 4/5, 2016 at 14:58 Comment(1)
you can refer official document of distance matrix api - developers.google.com/maps/documentation/distance-matrix/…Estimate

© 2022 - 2024 — McMap. All rights reserved.