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
1 answer

Configuring Google API Key Restrictions

I have attempted to configure Google API restrictions for the Distance Matrix API. I am using this API from my personal computer only at this time. Eventually, I may also call this from an AWS EC2 instance. I am using Python to connect to the…
0
votes
0 answers

Finding min geofence radius from a given lat-lng

I have a lat-lng of a location. I want to create a geofence (min radius) around that lat-lng such that the radius of geofence should be just big enough to the nearest road. Say for ex: I am inside a huge apartment. From my current location (inside…
0
votes
1 answer

how can i find or send shortest path to drawing route google distance matrix api?

I want to draw a route without traffic calculation. I try distance matrix service but ı can't find solution so when the response back from distance matrix service ı want to compare the routes and send shortest path to drawing but ı failed that…
0
votes
2 answers

Invalid 'departure_time' parameter when using Google distance matrix api

I want to calculate the drive time using the distance matrix API - while doing so I need to calculate the drive time at specific times of the day and therefore I'm using the departure_time parameter. However, I can't seem to figure out the correct…
Chipmunk_da
  • 467
  • 2
  • 9
  • 27
0
votes
0 answers

travel time from google maps API does not vary with time of day

I used gmapdistance to calculate travel time between two points in New York at different times. Can someone please tell me why is the travel time same and is not varying with time of day? library(gmapsdistance) library(lubridate) # key is…
SiH
  • 1,378
  • 4
  • 18
0
votes
0 answers

Google Map Distance Matrix units not showing correctly

The below doc says by default the units will show based on the origin. https://developers.google.com/maps/documentation/distance-matrix/overview#units I am testing with two addresses both in USA. I am expecting the distance to show in miles but it…
Sowmyan Soman
  • 853
  • 1
  • 9
  • 21
0
votes
1 answer

Using distance matrix to calculate distance between points with latitude and longitude in Python

I am trying to calculate the distances between points by using gmaps.distance_matrix() with a google api. The code outputs unreasonable results, but I can't find where the error is. Here is my code: gmaps = googlemaps.Client(key=API_key) origins =…
Wu Kris
  • 77
  • 8
0
votes
1 answer

How To use DistanceMatrix Api in Spring boot Application

I have a requirement to use DestanceMatrix API to calculate the distance between origin to destination. can anyone help me to implement this functionality in the spring boot Application? Thanks in advance...
0
votes
0 answers

how to pass multiple path points in google distance matrix api using javascript

Hello I want to pass multiple path points in google distance matrix API Currently i am passing this "https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins="+originsLatLong+"&destinations="+destinationLatLong; …
0
votes
1 answer

Uncaught TypeError: Cannot read property 'apply' of undefined when trying to find distance matrix Javascript

Im trying to find the distance matrix between two points in Google Maps API and im getting this error. Uncaught TypeError: Cannot read property 'apply' of undefined at distance_matrix.js:4 at Ku.j (distance_matrix.js:3) at Object.c [as _jr083s]…
0
votes
0 answers

How do I return values from google.maps.DistanceMatrixService()?

Problem: I've tried as many ways as I know how and I'm still struggling to return values from googles DistanceMatrixService. What I am trying to do is create a function that takes in an object: { id: id, currentLat: lat, currentLng: lng, …
0
votes
1 answer

urllib.error.HTTPError: HTTP Error 404: Not Found using Google Matrix API

I am trying simply to get the distance matrix data but the url just seems not to be working. This is my code, I obviously didn't place the key but that's not the problem import urllib.request import…
0
votes
1 answer

Google API | Distance Matrix

I need help with my code. First, is my approach correct that I use the GoogleDistanceMatrix to get the real route distance and not just the linear distance? I want to use an Geocoordinate for the origin and destination Adress but it doesnt seem to…
PabloS
  • 81
  • 1
  • 8
0
votes
0 answers

How to show message that if user lat long is outside 200 meters from specific location lat long using google matrix api

I am capturing users current location lat long and comparing it with specific location lat long(location lat long stored in db) and comparing both, if user lat long is more than 200 meters show message you are outside 200 meters, but in output I am…
user_1234
  • 741
  • 1
  • 9
  • 22
0
votes
1 answer

How to send multiple origins, each origin having its own multiple destinations, to Google Distance Matrix on the query-string

I am working with C# WebClient and the UriBuilder class, communicating with the Google Distance Matrix API. My program is sending comma-separated latitude,longitude pairs. Things are working properly with one origin and multiple destinations: the…
Tim
  • 8,669
  • 31
  • 105
  • 183