Getting shortest distance from route REST call

820
2
Jump to solution
06-12-2017 10:25 AM
DRMDevelopment
New Contributor

I am currently executing a pretty standard routing request call to get the driving distance from a starting point to an ending point, using the REST API (ArcGIS REST API ). Is there any way to get ArcGIS to return the shortest distance for the request, rather than whatever they consider to be the "best" route? Or, is there some way to get a list of different routes (such as fastest, shortest, etc)?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
DRMDevelopment
New Contributor

Mir Hashmi - I was already using the Directions API via REST, per the link I had included.

After digging through the documentation further, I found out that the shortest route can be calculated by setting impedenceAttributeName to Miles, which tells the service to minimize the travel distance between stops instead of the default, which is time.

View solution in original post

2 Replies
MirHashmi
Occasional Contributor

Hi, This link for Directions API will give you an idea of available services that you are looking for. It covers documentation and lots of samples.

0 Kudos
DRMDevelopment
New Contributor

Mir Hashmi - I was already using the Directions API via REST, per the link I had included.

After digging through the documentation further, I found out that the shortest route can be calculated by setting impedenceAttributeName to Miles, which tells the service to minimize the travel distance between stops instead of the default, which is time.

View solution in original post