Routing task
You can use a RouteTask
object to find routes between two or more locations, and optionally to get driving directions. The RouteTask
uses a network analysis service to calculate the routes, which can be both simple (what's the quickest way to get from A to B?) and complex (involving multiple stops, barriers, and time windows). The RouteTask
uses a least-cost path between multiple locations in a network. Impedance on the network can include time and distance variables:
![](https://static.packt-cdn.com/products/9781787280526/graphics/044848fa-e1ac-49e5-bb20-4d98249162be.png)
As with the other tasks we have examined in this book so far, routing is accomplished through a series of objects including RouteParameters
, RouteTask
, and RouteResult
:
![](https://static.packt-cdn.com/products/9781787280526/graphics/01db6d61-d266-4233-a63e-a4992d92d517.png)
The RouteParameters
object provides the input parameters to RouteTask
which executes the routing operation. Results are returned from ArcGIS Server in the form of a RouteResult
object.
RouteParameters
can include stop and barrier locations, impedance factors, whether or not to return driving directions, and many other options, too many to go into in...