Questions tagged [google-distancematrix-api]

The Google Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations

The Google Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations. The information returned is based on the recommended route between start and end points, as calculated by the Google Maps API, and consists of rows containing duration and distance values for each pair.

This service does not return detailed route information. Route information can be obtained by passing the desired single origin and destination to the Directions API.

Official Documentation

395 questions
17
votes
2 answers

Google Maps Distance Matrix wrong result

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…
shukshin.ivan
  • 11,075
  • 4
  • 53
  • 69
14
votes
1 answer

Is It compulsory to enable billing account by June 11, 2018 through credit card information to continue to access Google Maps API?

Per Google, "Beginning on June 11, 2018, you’ll need to enable billing with a credit card and have a valid API key for all projects. This will give you the ability to scale easily with less downtime and fewer performance issues. In addition, we’re…
11
votes
1 answer

Google maps api v3 calculate mileage by state

I'm searching for a way to calculate mileage by US State based on an origin, waypoints and destination of a route using Google Maps API v3. I have tried using Googles Distance Matrix API but this it is calculating the distance between 2 points,…
Adrian P.
  • 5,060
  • 2
  • 46
  • 47
8
votes
8 answers

Google Distance Matrix API

I was trying to use Google Distance Matrix API JSON in my project, after formatting the url, for example: …
8
votes
1 answer

Duration_in_traffic less than duration in google Distance Matrix API

I am using both the "duration_in_traffic" and "duration" feature using the DistanceMatrix API. For a given coordinate pair, I see the following results: { "destination_addresses": [ "Hamburg, Germany" ], "origin_addresses": [ "85748…
8
votes
1 answer

Can I pass multiple travel modes when using The Google Maps Distance Matrix API

I need to calculating times and distances with multple travel modes, I try to pass multiple travel modes separated with | like…
FAN Li
  • 83
  • 1
  • 3
6
votes
2 answers

Connection Error while using requests to get response from google distance matrix api

I am trying to develop something which involves finding distance between two geo locations. There are many such combinations of source and destination, which I am passing into google distance API in a loop. Part of my code: key_list =…
6
votes
3 answers

How to use Google Maps Distance Matrix JAVA API to obtain closest distance between source and multiple destinations

I have added the dependency of Google Maps API Java Client in my Java project. I have a set of origin distances, destination distance and also teh GeoApiContext as such: GeoApiContext context = new GeoApiContext().setApiKey(MY_API_KEY); String[]…
tsaebeht
  • 1,570
  • 5
  • 18
  • 32
5
votes
1 answer

Google Distance Matrix API: How to specify origin-destination pairs?

I am using the Python client library for Google Maps API (Github link). I would like to get the duration_in_traffic figures for the following trips: Address1 to Address2 Address2 to Address1 Address1 to Address3 Address3 to Address1 But the syntax…
5
votes
0 answers

How to use departure_time on google distance matrix api

In reading the documentation https://developers.google.com/maps/documentation/distance-matrix/intro the departure_time must be set in the future and based on January 1, 1970 UTC 00:00:00. This tells me that if I run a Distance Matrix API request…
CFRBill
  • 51
  • 4
4
votes
1 answer

Why I keep getting an error of MAX_ELEMENTS_EXCEEDED when I don't overpass the daily free number of requests?

So I developed a code where I read a file with some locations (15 to be more precise), where the first one is the depot and the other 14 locations are the places where a bus needs to pass to collect patients. In order to do that, I use Google Maps…
4
votes
2 answers

JSON Nested Elements Undefined

I am having extreme difficulty accessing nested values in JSON arrays, and for the life of me cannot figure out why my attempts are resulting in undefined values. I am trying to get the distance between two postcodes using the Google Distance Matrix…
cmprogram
  • 1,854
  • 2
  • 13
  • 25
4
votes
2 answers

MAX_DIMENSIONS_EXCEEDED distancematrix error

I know that "MAX_DIMENSIONS_EXCEEDED" error showing when Your request contained more than 25 origins, or more than 25 destinations. But Just I want to know this limit is only for free api customer or it's for all? I am using below google…
Asha Gajjar
  • 43
  • 1
  • 3
4
votes
1 answer

TypeError: gapi.auth2.getAuthInstance(...) is null

I'm trying to write a tool that uses the Google Distance Matrix API, but I keep running into authorization issues. I've been working from the following examples (to no avail):…
3
votes
1 answer

How to create a vehicle route optimization problem using or-tools and google-distance matrix while nullifying the end location only?

I am trying to create a vehicle routing problem for multi-drivers with pickup and drop-off locations. The starting point for each driver is their current location and the ending point would be anywhere they end. The input to my algorithm is a series…
1
2 3
26 27