Is there any way to ignore one-way streets using ArcGIS Online routing service?

2068
1
Jump to solution
04-28-2016 01:22 PM
j_rsg
by
New Contributor III

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?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
j_rsg
by
New Contributor III

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:

  • TravelTime (default)—Models travel times for a car. These travel times can be dynamic, fluctuating according to traffic flows, in areas where traffic data is available.
  • TruckTravelTime—Models travel times for a truck. These travel times are static for each road and don't fluctuate with traffic.
  • WalkTime—Models travel times for a pedestrian. The default walking speed is 5 kilometers per hour (3.1 miles per hour), but you can change that speed through the attributeParameterValues parameter by setting Walking Speed (km/h) to a different value.
  • Miles—Specifies that the travel distance between the stops should be minimized. The total distance between the stops is calculated in miles.
  • Kilometers—Specifies that the travel distance between the stops should be minimized. The total distance between the stops is calculated in kilometers.

View solution in original post

1 Reply
j_rsg
by
New Contributor III

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:

  • TravelTime (default)—Models travel times for a car. These travel times can be dynamic, fluctuating according to traffic flows, in areas where traffic data is available.
  • TruckTravelTime—Models travel times for a truck. These travel times are static for each road and don't fluctuate with traffic.
  • WalkTime—Models travel times for a pedestrian. The default walking speed is 5 kilometers per hour (3.1 miles per hour), but you can change that speed through the attributeParameterValues parameter by setting Walking Speed (km/h) to a different value.
  • Miles—Specifies that the travel distance between the stops should be minimized. The total distance between the stops is calculated in miles.
  • Kilometers—Specifies that the travel distance between the stops should be minimized. The total distance between the stops is calculated in kilometers.