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
0
votes
2 answers

My google key not being recognised in distance matrix

I have some input i am getting from a client and posted to teh server via ajax. A ample of such data is Woodvale Grove, Nairobi, Kenya| Garissa| Mombasa Road I am using php and i am then making this request with my key $pickup =…
Gandalf
  • 1
  • 29
  • 94
  • 165
0
votes
0 answers

Is there any google API by which we can calculate distance between multiple points?

I have to calculate distance between multiple points through google distance matrix API. I have a plugin which has inputs like Pickup address, pickup via, dropoff-address and then a checkbox to select return drive. If return drive box is checked,…
vipworks
  • 13
  • 1
  • 5
0
votes
1 answer

Split - Apply - Combine with dist_google() function (stplanr package)

I have the following data frame of long/lat points (points): GPSLatitude GPSLongitude 1 40.66126 22.89565 2 40.66127 22.89565 3 40.66128 22.89565 4 40.66130 22.89566 5 40.66131 22.89567 6 40.66132 …
Anas.S
  • 193
  • 1
  • 11
0
votes
2 answers

How to calculate fuel price of journey with multiple locations based on user input

I'm trying to create a codepen which calculates the distance from point A to point B and C. Also let's say for argument's sake that fuel/gas costs £1 per mile. I'm trying to add up the total distance between all the points (based on user input) and…
Connor
  • 351
  • 8
  • 23
0
votes
1 answer

Node.js Storing Current Date as Epoch Value

I know there are many questions relative to this, but I can't find exactly what I am looking for.. I am creating an iOS Rideshare app and am utilizing the Google Distance Matrix. What I am looking to do is taking the current date and set it to…
LameBanana
  • 49
  • 4
0
votes
1 answer

TypeError: Cannot read property 'elements' of undefined

I am currently building a ridesharing app on iOS and have run into some issues while using the Google Distance Matrix in my Node.js code. Below is the code: distance.matrix(leg3_origin, leg3_destination, function (err, distances) { …
LameBanana
  • 49
  • 4
0
votes
0 answers

Calculate distance using googleway

I am using googleway package in R to calculate distances between two points. I had 2 variables names household latitude and longitude and 2 other variables containing lat and long of the corresponding government cooperative store in the locality of…
0
votes
0 answers

C# Desktop App - Calculate distance between two cities using google maps api

I want to create a windows app which calculates the distance between two cities using google maps api. I can handle this using Javascript code below, however, I don't have an idea how I can call this in windows desktop app. 1-) Can I call this…
MareCieco
  • 157
  • 1
  • 19
0
votes
1 answer

Lambda expression returning null android

I'm writing a lambda expression to convert the given latitude and longitude into an address. The expression is supposed to take co-ordinates as arguments and returns their corresponding address. However, the value returned is null. Following is my…
Tejas Belvalkar
  • 193
  • 1
  • 2
  • 11
0
votes
1 answer

Async function not handled by completion handler

I am using the google maps distance matrix api and using a compeletion handler to pass my async function calls like this: func configureRoute(origin:String,destination:String, completionHandler: @escaping (_ duration:Int) -> ()){ let jsonURL =…
Arnav GUPTA
  • 295
  • 1
  • 2
  • 17
0
votes
1 answer

Google distance matrix API. How to access an alternative routes?

I use google distance matrix api for get distance from point "a" to point "b". The problem is that I can't get an alternative routes. Google maps does not show a different(alternative) path. Only one. I use google distance matrix api, can there be…
0
votes
1 answer

how to get time value from google api in swift 3.0

here I pass latitude and longitude of source and destination place and I got response but how to get specific value from response.I am new in ios Developer.I pass lat and long in google API like this let travelTimeString : NSString =…
0
votes
2 answers

How to determine how many free google distance queries are left on my account?

I'm pulling distance/time information for a large number of origin/destination pairs using the Google Maps API in R. I'm currently using the gmapsdistance package but have looked at a few others. My premium API key includes 100k free queries per…
Kyle Ward
  • 889
  • 1
  • 8
  • 18
0
votes
2 answers

How do I find out the shortest route from Google Maps directions with alternatives=true?

Google Directions Api: https://maps.googleapis.com/maps/api/directions/json?origin=1.29068,103.851743&destination=1.324298,103.9032129&sensor=false&mode-driving&alternatives=true There are 3 routes in the link, but I have to edit my code to process…
0
votes
0 answers

Google Maps API - matching a request with the asynchronous response

I'm using the google maps distance matrix javascript API to query the travel time from one point to about 50 destinations. in order to do this, I need to break my query up into multiple chunks, since the google maps API allows only a maximum of 25…