Default routing is way off for this specific route

4770
10
08-21-2015 09:29 AM
IvanDemkovitch
New Contributor II

I'm using ArcGis REST API to get routes. Nothing special, just standard driving routes. Actually I'm using it for transportation industry but right now I didn't configure any travel modes and just call webservice as is. All I'm looking for is driving miles.

So, for example this one:

http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?stops=-92.247147...???

Little Rock, AR -> Houston, TX.

There is a direct route top to bottom, Google maps shows it with variations, about 450 miles.

Argis returns route that takes it through Fort Worth which is extra 100 miles(!!)

Any settings I can add to give me shortest driving route?

Tags (1)
0 Kudos
10 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ivan,

I saw you posted this question in different places. I will answer you here as well.

I wonder have you checked about this documentation for Route Services in REST API

If you want to customize your own Travel Mode, you need either log into your organization account for arcgis.com to create a new "Travel Mode" followed by this doc Travel modes—ArcGIS Online Help | ArcGIS

onlinggis.JPG

OR

You need to specify the JSON object containing the settings for a travel mode supported by your organization. To get a list of supported travel modes, execute the GetTravelModes tool from the Utilities service.

If you don't set travelMode, the service honors the default or user-defined values for the parameters that would otherwise be overridden, so you can create your own travel mode.

Hope this can help!

IvanDemkovitch
New Contributor II

Hi Yue!

I went this route, pulled modes and tried different ones. I also tried to create my own and set as default. Same thing, this route returned as 560 miles. See what google shows (and others like Bing) for same route. Generally ESRI routing OK, this one is just buffling me. It does it no matter what settings I set. I wonder what would be their "shortest route" profile setting.

See routes from bing and what esri gives me (100 miles difference)

esri.JPG

Everybody

everybody.JPG

0 Kudos
IvanDemkovitch
New Contributor II

Also.. Is there time delay for travel Modes publishing? I made changes under account about half hour ago but I still don't see my custom travelModes when I call Utilities Service

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ivan,

Make sure you pass the token that generated from arcgis.com.

Something like this:

https://www.arcgis.com/sharing/rest/generateToken&username=*****&password=******&expiration=3600&ref...

And the use the token to append under this URL to acquire your customize "Travel Mode"

http://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GPServer/GetTravelModes/execute?tok...

IvanDemkovitch
New Contributor II

I do use token, of course... I did regenerate token again, just in case it's needed (as we cache them for a while). My link differs a little from yours, but I guess it's the same thing, token works for REST API anyway.. So. My custom created routes did not show on a list. And from what I read and re-read it doesn't really matter, I can pass all parameters into the call itself. It should take "DEFAULT" travel mode from my account. Well, default is least restrictive. Basically, no restrictions. And it still gives me 560 miles route. I contacted support, let's see what they can tell me..

https://www.arcgis.com/sharing/oauth2/token?client_id={0}&grant_type=client_credentials&client_secre...

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ivan,

I would recommend to try to use your organization arcgis.com to generate the token rather than client_id and client secret.

I had a client who using clientID and client secrets couple days ago but it fails as well. Try using my previous link that provide to you to see just as a test. You should get the Travel Model with this method.

It is good move to contact support to get more detail helps about this issue.

IvanDemkovitch
New Contributor II

Nothing fails for me, tokens I get obviously work because of successfull calls to various web services. But when I get travel modes it returns only standard ones. I'm with you on this one, using different way to get token (which I wasn't aware about when I did develop it initially) but will wait for tech support response.

In my mind standard route with impedance=miles should be all thats needed. Let's see what support says.

0 Kudos
IvanDemkovitch
New Contributor II

Got an answer. Expected or not expected - this is a bug

this is expected behavior due to the way Hierarchies
work, particularly in REST.

When you enable a Hierarchy, the algorithm will
prioritize higher-order streets like Highways/Freeways over lesser roads, and
in this case it is (unfortunately) at the expense of a significant time and
distance accumulation.

Normally, you can disable the hierarchy (with the Network
toolbar or the Network Analyst GP tools), but in the case of the REST API,
hierarchy is automatically enabled when distance between stops is over 50
miles. This is mainly to avoid request time outs and failures.

The good news is that our development team is working on
refining the hierarchy so that these kinds of issues can be avoided. Ideally, a
fix may be in place some time near spring of next year.

Other than that, there is no way to avoid using Hierarchy
in REST. I realize it may not be possible or convenient for your workflow, but
the other options would be to use the ArcMap tools instead.

0 Kudos
Reynaldde_Castro
Occasional Contributor

Can this be used by Javascript API? If so, how?

0 Kudos