1

I am working on the application where I need to calculate the distance between 2 points on road. I am trying to make use of the Google API's to find the same.

However, I am seeing the difference in between Distance calculate by Distance Matrix/Direction Service vs Google Map.

e.g. Distance Matrix Call -

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&mode=driving&origins=32.9068408094901%2C-117.16891048788365&destinations=32.88825094509964%2C-117.21174850405791

Returns Data as enter image description here Direction Service API Call -

https://maps.googleapis.com/maps/api/directions/json?origin=32.9068408094901%2C-117.16891048788365&destination=32.88825094509964%2C-117.21174850405791

Returns data as enter image description here

However, Google Map returns completely different results enter image description here

I want to understand -

  1. Difference between Distance Matrix API and Direction service? They return same distance
  2. Why Google Maps return completely different distance?
Anup
  • 73
  • 2
  • 10
  • Stack Overflow is not the correct channel to ask this. If you want a precise answer, you can contact the Google Maps Platform support team by filing a support case: https://developers.google.com/maps/support/#creating-a-support-case – jabamataro Dec 06 '21 at 06:57
  • Just to provide some context, [Distance Matrix API](https://developers.google.com/maps/documentation/distance-matrix/overview) will only provide the travel distance and time for a matrix of origins and destinations while [Directions API](https://developers.google.com/maps/documentation/javascript/directions) provide the step by step directions, number of turns, from one point to another. – jabamataro Dec 06 '21 at 07:11

0 Answers0