I am trying to set parameters for a RouteTask using the ArcGIS Online routing service and I am unable to find any way to ignore one-way streets. I would have thought that setting the impedanceAttribute or travel mode to walk time should then ignore one-way streets, however that does not appear to be the case. It does not make sense that walk mode would have to follow a one-way street restriction. Using Google maps, for example, you get the expected output if you choose walk mode for the directions.
I know if you are building your own network analysis service from scratch you can set a rule to ignore one-way streets, but I will not be doing that and hosting my own service.
Any ideas if this can be done or if it will be added in the future?
Solved! Go to Solution.
So I managed to solve my own question after further work. Yes, the walk mode does ignore one-way streets. I should have outlined the original question better, but here's some tips for anyone else using the ArcGIS Online routeTask in the future.
For the routeTask sample (ArcGIS API for JavaScript Sandbox) I set the travelMode based on the example format shown for the Route Service from the ArcGIS REST API :
routeParams.travelMode={"attributeParameterValues":[{"parameterName":"Restriction Usage","attributeName":"Walking","value":"PROHIBITED"},{"parameterName":"Restriction Usage","attributeName":"Preferred for Pedestrians","value":"PREFER_LOW"},{"parameterName":"Walking Speed (km/h)","attributeName":"WalkTime","value":5}],"description":"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.","impedanceAttributeName":"WalkTime","simplificationToleranceUnits":"esriMeters","uturnAtJunctions":"esriNFSBAllowBacktrack","restrictionAttributeNames":["Preferred for Pedestrians","Walking"],"useHierarchy":false,"simplificationTolerance":2,"timeAttributeName":"WalkTime","distanceAttributeName":"Miles","type":"WALK","id":"caFAgoThrvUpkFBW","name":"Walking Time"}
That did the trick and ignored one-way streets.
Also, just setting the impedanceAttribute to "WalkingTime" did change the routing from standard "TravelTime" but did not ignore one-way streets on its own. I ended up using the travelMode settings above instead.
One last tip. The format for the impedanceAttribute (RouteParameters | API Reference | ArcGIS API for JavaScript ) should actually come from the impedanceAttributeName format in the Rest API if you are using the ArcGIS Online service. That confused me initially. The values are:
So I managed to solve my own question after further work. Yes, the walk mode does ignore one-way streets. I should have outlined the original question better, but here's some tips for anyone else using the ArcGIS Online routeTask in the future.
For the routeTask sample (ArcGIS API for JavaScript Sandbox) I set the travelMode based on the example format shown for the Route Service from the ArcGIS REST API :
routeParams.travelMode={"attributeParameterValues":[{"parameterName":"Restriction Usage","attributeName":"Walking","value":"PROHIBITED"},{"parameterName":"Restriction Usage","attributeName":"Preferred for Pedestrians","value":"PREFER_LOW"},{"parameterName":"Walking Speed (km/h)","attributeName":"WalkTime","value":5}],"description":"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.","impedanceAttributeName":"WalkTime","simplificationToleranceUnits":"esriMeters","uturnAtJunctions":"esriNFSBAllowBacktrack","restrictionAttributeNames":["Preferred for Pedestrians","Walking"],"useHierarchy":false,"simplificationTolerance":2,"timeAttributeName":"WalkTime","distanceAttributeName":"Miles","type":"WALK","id":"caFAgoThrvUpkFBW","name":"Walking Time"}
That did the trick and ignored one-way streets.
Also, just setting the impedanceAttribute to "WalkingTime" did change the routing from standard "TravelTime" but did not ignore one-way streets on its own. I ended up using the travelMode settings above instead.
One last tip. The format for the impedanceAttribute (RouteParameters | API Reference | ArcGIS API for JavaScript ) should actually come from the impedanceAttributeName format in the Rest API if you are using the ArcGIS Online service. That confused me initially. The values are: