Calculate distance between source and destination via given coordinates

1809
3
10-23-2017 11:52 PM
JayP
by
New Contributor

We are a truck logistics company and we want to calculate the distance between source and destination on which the truck traveled.

As of now, we are using Google Maps API to calculate the distance. The problem we have with Google Maps API is, we can't calculate the distance on the route the truck has traveled. We have the location coordinates(collected every minute) on which the truck traveled but we can't pass these coordinates to Google Maps API to get the distance for the traveled route.

Is there any API in ArcGIS/ESRI to calculate the distance between source and destination via given coordinates(or way-points)?

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

The Network Analyst is capable of returning the routes from which you can determine the distance travelled.  See specific details in the 'line shape' in Make Route Analysis . There are other options there as well

Or are you wanting to simply determine the distance between the two points as a geodesic distance (see Vincenty for geographic coordinates  if that is the case)

Or if you have projected coordinates, then the distance/length is a simple field calculation.

JaySandhu
Esri Regular Contributor

The answer is Yes. The routing service computes a route between stops. You can pass in the coordinates of the path the truck took as stops but change their location type to "waypoints". That way, the route will solve a path through the points you pass in and return back one route from start stop to end stop. You can get more info on the routing service and way points here:

ArcGIS REST API 

Jay Sandhu

PrakashMani
New Contributor II

Thanks Jay, it worked to our expectation...