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
1
vote
0 answers

when i was try to get distance between two set of latlng in google map api i will get error

this is a parameter i was passed String[] fromPoint:["40.7127837,-74.0059413","33.9533487,-117.3961564"]; String[] toPoint:["38.6270025,-90.19940419999999","12.8445,80.1523"]; // this is code i was written, i was convert string to latlng and when i…
1
vote
0 answers

I am working on google map distance matrix API which is working in debug mode but not in release mode

I am working on google map distance matrix API which is working in debug mode but not in release mode. I have tried every method mentioned in posts . This Is My Gradle apply plugin: 'com.android.application' android { …
Daksh Semwal
  • 99
  • 2
  • 11
1
vote
2 answers

Javascript Loop skips array values

I am trying to do a for loop with javascript to loop through an array and print the values for each of the array. It is looking for distance and duration using Google distance matrix api. My code is here:…
1
vote
1 answer

An algorithm to overcome the elements limit posed by the distance matrix API

Firstly, I've done a StackOverflow search so I know this is new. Kindly read on: So I have a string array of 9 places and need to find the distance of them from each other to input into an algorithm. I used Google's Distance matrix API and pass…
1
vote
2 answers

Properly getting the sorting order of this array in PHP

I have a 2-dimensional array which the values... 9999999999999999 3201 4584 4821 1628 1218 1786 4738 4897 3122 9999999999999999 1400 1638 1797 2756 3323 5310 5472 4523 1400 9999999999999999 237 3198 4156 4723 6711 6872 4760 …
1
vote
1 answer

Receiving "Invalid_Request" response from Google-DistanceMatrix api in VBA

I'm sending an XML Request to the google-distancematrix api with a string that looks like: https://maps.googleapis.com/maps/api/distancematrix/xml?origin=Grafton,+VA&destination=Yorktown,+VA&key=myKey and am getting the following…
dbWizard
  • 122
  • 8
1
vote
0 answers

Google Maps Distance Matrix API

For the trafficModel parameter (using bestguess), the guide indicates that the returned duration_in_traffic should be the best estimate of travel time given what is known about both historical traffic conditions. Given the time you enter in secs (as…
PJG
  • 11
  • 1
1
vote
2 answers

Google Maps API and duration_in_traffic

I am trying to understand DistanceMatrix API. When I do this on…
Gus
  • 11
  • 3
1
vote
3 answers

How to get covered distance by transit

I want to create an app in which I want to show how much distance does the user has been traveled. I have tried using float distance = locationA.distanceTo(locationB); but it just draws a simple straight line from start to end and then calculates…
1
vote
0 answers

Optimal way to build and fill a distance matrix using Google Maps API

Say I have a distance matrix like so | Location 1 | Location 2 | Location 3 | --------------------------------------------------| Location 1 | | | | Location 2 | | | …
gh0st
  • 1,653
  • 3
  • 27
  • 59
1
vote
0 answers

Google Distance Matrix API returning results in incorrect order

I'm using the Google Distance Matrix API to return the travel time over different modes of transport. While it works sometimes, it seems that results are not always consistent and are outputted in incorrect order. I'm reading from a CSV of Lat's…
ohhimark
  • 11
  • 5
1
vote
1 answer

Ionic 3/Google Distance Matrix API

The basic idea I am trying to execute is: I have a list of branches, each having lat, lng attributes in them, which contain latitude, and longitude. I want to use the Google Distance Matrix API to find the distance and duration to each one of…
1
vote
0 answers

How to input multiple departure dates and times in gmapsdistance R package?

I am using the R package, gmapsdistance, to extract Google distance matrix. My codes are: gdm <- gmapsdistance(origin = origin_vector, destination = destination_vector, combinations = "pairwise", …
Aris123
  • 11
  • 1
1
vote
1 answer

Python, Google Distance Matrix API: Incorrect Address Output

I am trying to find the distance between multiple addresses in a CSV file. However, when trying to single out the issue, the output returns the same incorrect address no matter when I put in the lat/long, or physical address. import…
1
vote
2 answers

Unable to get response from Google distance matrix api

I am using google distance matrix API and i am using following code let headers: HTTPHeaders = [ "Accept": "application/json", "Content-Type": "application/json" ] let url =…
Khushbu Desai
  • 1,003
  • 1
  • 10
  • 32