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

Optimize use of google distance matrix api

I am working on services for app in which I need to show the listing of nearby places along with the driving distance for each place from the current user location . For places I am using google place api which is hit once for each request but…
alwaysLearn
  • 6,882
  • 7
  • 39
  • 67
1
vote
0 answers

Calculate distances from one LatLng to many LatLng using Google Places API

I'm developing a small application to search a nearby location from current location. I type something like "New york" in the textbox then the listview with filled with the list of matched nearby query "New york". I made this done by using Google…
1
vote
0 answers

Different routes?

I'm working with the Google distance API. We had a user report the mileage of a round-trip that's wrong. When I investigated I notice it routes them one way going from A to B then a different going from B to A. Why does that happen? Here's the…
David D.
  • 11
  • 1
1
vote
0 answers

Speeding up python URL requests with multiprocessing (Google API)

I'm using Google's Distance Matrix API and wanted to get up to the rate limit of 1000 requests in 10 seconds without necessarily using the matrix component but just higher limit capability (directions API has 10 a second -> this in effect has 100 a…
1
vote
1 answer

Google Distance matrix for work is giving me invalid request when signing request with clientId and crypto key

I am trying to obtain distance between two locations using Google Distance matrix API. I am using a signature as well to sign my request to Google. Here is my request…
Aman Gupta
  • 71
  • 1
  • 10
0
votes
1 answer

MatrixDistance API from Google for iOS

I am trying to build an app with a map in which the user would select his origin address and destination address.. It all works fine, but I can't access the Google API Distance Matrix.. I am try with following: NSString *urlPath = [NSString…
dsafa
  • 783
  • 2
  • 8
  • 29
0
votes
0 answers

How to parse Distance Matrix in JS to only get the distance and the duration?

I have been trying to only get the distance and duration using the Google Distance Matrix API. I tried and built and modified as I logically could but nothing. I even slice the response because I did not succeed to parse it. I have multiple…
0
votes
1 answer

Cities missing in Google Maps API distance matrix

I have been using the Google Maps API's distance matrix. However, this seems to not be working for some cities and I'd need your help to figure out why / what I'm doing wrong. Here's what I'm typing to find the distance between Paris (France) and…
0
votes
1 answer

Find nearest hospital from latitude and longitude data in python/pandas

Patients often bypass their nearest hospital to go to another hospital for surgery (- many reasons for that). I have 500,000 patient episodes of patients attending 24 hospitals in the UK. I want to know the proportion of patients attanding a…
capnahab
  • 343
  • 3
  • 14
0
votes
1 answer

Is region no longer needed for Distance Matrix calls using Python library?

Previously I used the code below to call the distance matrix api using they python package googlemaps. The call worked last year 2021 but this year (2022) I get an error message to say distance_matrix() got an unexpected keyword argument…
mobcdi
  • 1,532
  • 2
  • 28
  • 49
0
votes
0 answers

I am getting really long wait times getting results using googles distance matrix

I am building a small project to help find locations to a user and give the distance between the two. I found some code using the distancematrix that works like a charm, that is until I started including more locations to find the distance between…
Dr5056732
  • 29
  • 6
0
votes
0 answers

TypeError: Cannot read properties of undefined (reading 'maps')

I am trying to use the DistanceMatrixService from @react-google-maps/api. One of the required parameters is the 'travelMode'. However, when I tried setting 'travelMode' to 'DRIVING', it shows the following! I tried doing travelMode:…
0
votes
1 answer

DistanceMatrixApi using multiple destination lat/lon points

I'm using the client api specification code that was created from their openapi-specifcation located here https://github.com/googlemaps/openapi-specification/releases. (version v1.17.6) I created all the client libraries and I'm using them to call…
0
votes
1 answer

How to make a distance matrix for traveling salesman problem using most cost effective way?

We are trying find the optimum route for given sets of addresses. Here optimum route meanibg going every address using shortest distance, We are using Traveling salesman approach to solve this, the problem is to work this algorithm perfectly we need…
0
votes
0 answers

struct for parsing google distance json in swif

This is the json output from https://maps.googleapis.com/maps/api/distancematrix/json?origins=rijssen&destinations=almelo&mode=driving&language=en&key= { "destination_addresses" : [ "Almelo, Netherlands" ], "origin_addresses" : [ "Rijssen,…
Marcel
  • 31
  • 1