Available with Network Analyst license.
Solving a route analysis can mean finding the quickest, shortest, or even the most scenic route, depending on the impedance you choose to solve for. If the impedance is time, then the best route is the quickest route. If the impedance is a time attribute with live or historical traffic, then the best route is the quickest route for a given time of day and date. Hence, the best route can be defined as the route that has the lowest impedance, or least cost, where the impedance is chosen by you. Any cost attribute can be used as the impedance when determining the best route.
You can accumulate any number of impedance attributes in a route analysis, but accumulated attributes don't play a role in computing the path along the network. For example, if you choose a time cost attribute as the impedance attribute and want to accumulate a distance cost attribute, only the time cost attribute is used to optimize the solution. The total distance is accumulated and reported, but the path isn't calculated from distance in this example.
Finding the best route through a series of stops follows the same workflow as other network analyses.
Learn more about the network analysis workflow
Route analysis layer
The route analysis layer stores all the inputs, parameters, and results of a route analysis.
Creating a route analysis layer
You can create a route analysis layer from the Network Analyst toolbar by clicking Network Analyst > New Route.
When you create a new route analysis layer, it shows up in the Network Analyst window along with its five network analysis classes—Stops, Routes, Point Barriers, Line Barriers, and Polygon Barriers.
The route analysis layer also appears in the Table Of Contents as a composite layer, which is named Route (or, if a route with the same name already exists in the map document, Route 1, Route 2, and so on). There are five feature layers—Stops, Routes, Point Barriers, Line Barriers, and Polygon Barriers. Each of the five feature layers has default symbology that can be modified on its Layer Properties dialog box.
Route analysis classes
The route analysis layer is composed of five network analysis classes.
Learn more about network analysis classes
An overview of each class and descriptions of their properties are provided in the following sections.
Stops class
This network analysis class stores the network locations that are used as stops in a route analysis. The Stops layer has four default symbols: located stops, unlocated stops, stops with errors, and stops with time violations. You can modify the symbology for the Stops layer in the Layer Properties dialog box, where there is a custom symbology category for stops, Network Analyst > Sequenced Points.
When a new route analysis layer is created, the Stops class is empty. It is populated only when network locations are added to it. A minimum of two stops is necessary to create a route.
Stop properties
Some of the stop properties are only available when a start time is defined or time windows are enabled, both of which are parameters on the Analysis Settings tab of the Route analysis layer's Layer Properties dialog box.
Input fields of stops
Input field | Description |
---|---|
ObjectID | The system-managed ID field. |
Shape | The geometry field indicating the geographic location of the network analysis object. |
Name | The name of the network analysis object. A name, which you can edit, is assigned automatically when the stop is added to the map. |
RouteName | This represents the name of the route to which the stop belongs. By using this property, stops within one route analysis layer can be assigned to multiple routes.
|
TimeWindowStart | This property stores the earliest time the network location can be visited. If TimeWindowStart is set to 10:00 AM and the route arrives at the stop at 9:50 AM, there is a wait time of 10 minutes that is added to the total time. If the network dataset has a time-zone attribute, the time-of-day fields refer to the same time zone as the edge that the stop is located on. This property is only available when time windows are enabled on the network analysis layer. |
TimeWindowEnd | This property stores the latest time the network location can be visited. Together, the TimeWindowStart and TimeWindowEnd properties make up the time window within which a route can visit the network location. If a location has a TimeWindowEnd value of 11:00 AM, and the earliest a route can reach the stop is 11:25 AM, a violation of 25 minutes is noted. Additionally, the stop is symbolized to display that it has a time window violation. If the network dataset has a time-zone attribute, the time-of-day fields refer to the same time zone as the edge that the stop is located on. This property is only available when time windows are enabled on the network analysis layer. |
Attr_[Impedance] (for instance, Attr_Minutes, where Minutes is the impedance for the network) | This property specifies how much time will be spent at the network location when the route visits it; that is, it stores the impedance value for the network location. A zero or null value indicates the network location requires no service time. For example, if you are finding the best route through three stops using Drivetime as impedance, the property Attr_Drivetime can be used to store the amount of time you expect to spend at each stop. If you start from Stop 1, reach Stop 2 in 10 minutes, spend 10 minutes at Stop 2, and reach Stop 3 in another 10 minutes, then the total time to reach Stop 3 is displayed as 30 minutes (10 + 10 + 10), even though there is only 20 minutes of traveling to reach Stop 3. |
Network location fields
| Together, these four properties describe the point on the network where the object is located. |
CurbApproach | The CurbApproach property specifies the direction a vehicle may arrive at and depart from the network location. There are four choices (their coded values are shown in parentheses):
|
Input/output fields of stops
Input/Output field | Description |
---|---|
Sequence | As an input field, this number represents the order in which the stops should be visited. Within a route, the sequence number should be greater than 0 but not greater than the maximum number of stops. Also, the sequence number should not be duplicated. If the analysis layer parameter Reorder Stops To Find Optimal Route is not checked, the resulting route visits the stops in the sequence specified. If the stops are allowed to be reordered by the solver, the optimal sequence is discovered, and Sequence is updated during the solve process. The recommended way to change the sequence value is by dragging stops above or below other stops in the Network Analyst window. |
Status | This field is constrained by a domain of values, which are listed below (their coded values are shown in parentheses).
After a solve operation, the status can be modified using one of the following status values:
If time windows are used and the route arrives early or late, the value changes to Time window violation (6). |
Output fields of stops
Output field | Description |
---|---|
ArriveCurbApproach | Indicates which side of the vehicle the curb is on when the vehicle approaches the network location. If the network location's CurbApproach value is set to Right side of vehicle, the ArriveCurbApproach after solving is Right side of vehicle. However, if the CurbApproach value is set to Either side of vehicle or No U-Turn, the ArriveCurbApproach could be on the right or left side depending on which produces the overall shortest path. |
DepartCurbApproach | Indicates which side of the vehicle the curb is on when the vehicle departs the network location. If the network location's CurbApproach value is set to Right side of vehicle, the DepartCurbApproach after solving is Right side of vehicle. However, if the CurbApproach value is set to Either side of vehicle or No U-Turn, the DepartCurbApproach could be on the right or left side depending on which produces the overall shortest path. |
Cumul_[Impedance] (for instance, Cumul_Minutes, where Minutes is the impedance for the network) | This property is the total impedance it takes to reach the stop. This includes the impedance incurred in traveling to the stop, the impedance of the stop, and the impedances of all the previous stops. In the example given for the input attribute, Attr_[Impedance], the Cumul_Drivetime for Stop 2 would be 20 minutes (10 minutes travel time + 10 minutes spent at Stop 2), and the Cumul_Drivetime for Stop 3 would be 30 minutes (20 minutes Cumul_Drivetime for Stop 2, plus 10 minutes travel time from Stop 2 to Stop 3). |
Wait_[Impedance] (for instance, Wait_Minutes, where Minutes is the impedance for the network) | This property stores the time spent waiting for the time window to open (TimeWindowStart) when the route arrives early. This property is only available when time windows are enabled on the network analysis layer. |
CumulWait_[Impedance] (for instance, CumulWait_Minutes, where Minutes is the impedance for the network) | This property stores a sum of how much time has been spent waiting for time windows to open (TimeWindowStart). It includes the time from the current stop and all previous stops visited by the route. This property is only available when time windows are enabled on the network analysis layer. |
Violation_[Impedance] | This property is a measure of how late the route arrived after the time window closed (TimeWindowEnd). Specifically, it stores the amount of time between the end of the time window and the arrival of the route. This property is only available when time windows are enabled on the network analysis layer. |
CumulViolation_[Impedance] | This property stores the cumulative violation time (Violation_[Impedance]) from the current stop and all previous stops visited by the route. This property is only available when time windows are enabled on the network analysis layer. |
ArriveTime | The date and time value indicating the arrival time at the stop. When using traffic data that covers multiple time zones, the time zone for this time-of-day value is taken from the network element on which the order is located. |
DepartTime | The date and time value indicating the departure time from the stop. When using traffic data that covers multiple time zones, the time zone for this time-of-day value is taken from the network element on which the order is located. |
Routes class
The Routes class stores the resulting route, or routes, from the analysis. As with other feature layers, its symbology can be accessed and altered from its Layer Properties dialog box.
The Routes class is an output-only class; it is empty until the analysis is complete. Once the best route is found, it is displayed on the Network Analyst window.
Route properties
Output fields of routes
Output field | Description |
---|---|
ObjectID | The system-managed ID field. |
Name | The name for the route is assigned automatically when the route layer is solved, either by reading the value from the RouteName property of the Stops class or, if that value is null, by integrating the name of the first stop in the route and the name of the last stop, for example, Graphic Pick 1 – Graphic Pick 8. You are able to rename the route from the Network Analyst window. |
FirstStopID | The ObjectID of the route's first stop. |
LastStopID | The ObjectID of the route's last stop. |
StopCount | The number of stops visited by the route. |
Total_[Impedance] (for instance, Total_Minutes, where Minutes is the impedance for the network) | The total impedance from the beginning of the first stop to the end of the last stop. The total travel impedance and the Attr_[Impedance] of the visited stops are included in this value. |
TotalWait_[Impedance] (for example, TotalWait_Minutes, where Minutes is the impedance of the network) | This property stores the route's overall wait time, which is the time spent at stops waiting for time windows to open. This property is only available when time windows are enabled on the network analysis layer. |
TotalViolation_[Impedance] (for example, TotalViolation_Minutes, where Minutes is the impedance of the network) | This property stores the route's overall violation time at stops. Violation time is added when the route arrives at a stop after the time window has ended; it is the difference between the ArriveTime and TimeWindowEnd. This property is only available when time windows are enabled on the network analysis layer. |
StartTime | The time the route begins. This property is only available when time windows are enabled on the network analysis layer. |
EndTime | The time the route is complete. This property is only available when time windows are enabled on the network analysis layer. |
Point, line, and polygon barriers
Barriers serve to temporarily restrict, add impedance to, and scale impedance on parts of the network. When a new network analysis layer is created, the barrier classes are empty. They are populated only when you add objects into them—but adding barriers is not required.
Barriers are available in all network analysis layers; therefore, they are described in a separate topic.
Route analysis parameters
Analysis parameters are set on the Layer Properties dialog box for the analysis layer. The dialog box can be accessed in different ways:
Learn more about opening the network analysis Layer Properties dialog box
The Analysis Settings tab
The following subsections list parameters that you can set on the analysis layer. They are found on the Analysis Settings tab of the analysis layer's Layer Properties dialog box.
Impedance
Any cost attribute can be chosen as the impedance, which is minimized while determining the best route. For instance, choosing the Minutes attribute results in the quickest route.
Restrictions
You can choose which restriction attributes should be respected while solving the analysis. In most cases, restrictions cause roads to be prohibited, but they can also cause them to be avoided or preferred. A restriction attribute, such as Oneway, should be used when finding solutions for vehicles that must obey one-way streets (for instance, nonemergency vehicles). Other common restriction attributes include height or weight limits that prohibit some vehicles from traversing certain roads or bridges; hazardous materials restrictions that hazmat drivers need to completely bypass or at least try to avoid; and designated truck routes that truck drivers should try to follow. You can choose which restriction attributes should be respected while solving the analysis. (You can further specify whether the elements that use the restriction should be prohibited, avoided, or preferred in the Attribute Parameters tab.)
Use Start Time
Use Start Time, in conjunction with the Time of Day and Specific Date or Day of Week properties, lets you specify when the route will begin from the first stop. Moreover, if you specify a time-only value in any date/time properties for the route analysis, such as time window properties, the date is assumed to be the date you set for Specific Date or Day of Week.
Note that specifying a start time doesn't require traffic data; yet, if the network dataset includes traffic data, the results of the analysis are more accurate. That is, the results are calculated for the start date and time that you set. For example, during rush hour, the route could take longer than during off-peak hours. Furthermore, the best path could change depending on traffic conditions at that time.
The route feature or features that are output by the solver have StartTime and EndTime properties when a time-based impedance is used with a start time. The StartTime value will match the value that you enter in the Use Start Time settings of the route analysis layer. The EndTime will be calculated from the start time and the duration of the route. The Directions window will display the start and end times when directions are generated.
Stops in a route analysis have an ArriveTime and DepartTime property when a time-based impedance is used with a start time. If you also choose to display the Time of day column in the Directions Options dialog box, the arrive and depart times at stops will appear in the Directions window. In fact, all directives in the Directions window will display a time of day.
Time of Day
The value you enter here represents the time you want the route, or routes, to begin. The default value of Time of Day is 8:00 AM.
The time must be associated with a date. You can choose between entering a floating day (Day of Week) or a calendar day (Specific Date).
Specific Date
For a calendar date, you provide the day, month, and year that the Time of Day value is associated with.
Day of Week
For a floating day, you can choose Today or any day of the week (Sunday through Saturday) relative to the current date. Floating days enable you to configure an analysis layer that can be reused, without having to remember to change the date.
Floating days are especially beneficial when used with traffic data since traffic changes from minute to minute and day to day. For example, if you calculate the same routes each day and need accurate times or the best routes given traffic conditions, you can choose the Day of Week and Today settings. The solver will generate results based on the traffic for the current day, which is determined from your computer's operating system. If you return the next day—for instance, May 5—to update the routes for that day, you can re-solve the same analysis layer. The solution will automatically be based on the traffic for May 5 since Day of Week was set to Today.
Likewise, when you choose Monday for the Day of Week property, then solve, the solution will be based on the traffic forecast for the next Monday. However, if today is Monday, the solution uses today's traffic data. You can solve up to six days ahead relative to the current day.
Using a start time with traffic data and time zones
If you use traffic data, the start time refers to the time zone of the edge or junction on which the first stop is located. There is one case in which this causes a solve to fail because the time zone can't be determined beforehand. That situation is created when your stops are located across multiple time zones and you check Reorder Stops To Find Optimal Route without preserving the first stop. You can avoid this failure by preassigning the first stop.
Use Time Windows
If a stop can be visited only during a particular time of day, its time window can be stored in the TimeWindowStart and TimeWindowEnd properties of the network location (stop). This check box enables or disables the usage of those time windows. If time windows are enabled, the route will be modified such that it honors the time windows. If the route is unable to honor some time windows, the affected stops will be symbolized as time-window violations.
Reorder Stops To Find Optimal Route
By default, a route traverses stops in the order you define. However, you can possibly shorten the route further by letting Network Analyst find the best order. It will account for a variety of variables, such as time windows. Another option is to preserve the origin and destination while allowing Network Analyst to reorder the intermediary stops.
When you check this property, the route analysis changes from a shortest-path problem to a traveling salesperson problem (TSP).
U-turns at Junctions
Network Analyst can allow U-turns everywhere, nowhere, only at dead ends (or culs-de-sac), or only at intersections and dead ends. Allowing U-turns implies the vehicle can turn around at a junction and double back on the same street.
Output Shape Type
The route features that are output by the analysis can be represented in one of four ways.
- True Shape gives the exact shape of the resulting route.
- True Shape with Measures gives the exact shape of the resulting route. Furthermore, the output includes route measurements for linear referencing. The measurements increase from the first stop and record the cumulative impedance.
- Straight Line results in a single, straight line between the stops.
- When the output shape type is set to None, no shape is returned.
Use Hierarchy
If the network dataset has a hierarchy attribute, you can use the hierarchy during the analysis. Using a hierarchy results in the solver preferring higher-order edges to lower-order edges. Hierarchical solves are faster, and they can be used to simulate the driver preference of traveling on freeways instead of local roads—even if that means a longer trip. Not using a hierarchy, however, yields an exact route for the network dataset.
Ignore Invalid Locations
This property allows you to ignore invalid network locations and solve the analysis layer from valid network locations only. If this option is not checked and you have unlocated network locations, the solve may fail. In either case, the invalid locations are ignored in the analysis.
Directions
With the Directions properties, you can set the units for displaying distance and, optionally, time (if you have a time attribute). Additionally, you can choose to open directions automatically after the generation of a route. (If you choose not to display directions automatically, you can click the Directions Window button on the Network Analyst toolbar to display directions.)
The Accumulation tab
Under the Accumulation tab, you can choose cost attributes from the network dataset to be accumulated on the route objects. These accumulation attributes are purely for reference; the solver only uses the cost attribute specified by the analysis layer's Impedance parameter to calculate the route.
For each cost attribute that is accumulated, a Total_[Impedance] property is added to the routes that are output by the solver, where [Impedance] is replaced with the name of the accumulated impedance attribute.
Assume you set the impedance attribute to Minutes because you want to find a route that minimizes travel time. Even though you're solving using travel time, you would also like to know the length of the quickest route. Suppose you have another cost attribute, Miles, that you check on in the Accumulation tab. After solving, the output route features will have properties named Total_Minutes and Total_Miles.
Conversely, you can find the shortest route and accumulate travel time to determine when the route will arrive at its stops and how long it will take to complete the trip. If you have a traffic-enabled network dataset, you can even find this information for a specific time of day and account for variable traffic speeds. To do this, choose a distance-based cost attribute for the impedance of the analysis layer, use a start time, and accumulate a time-dependent cost attribute.
The Network Locations tab
The parameters on the Network Locations tab are used to find network locations and set values for their properties.
Directions
Directions can be displayed in ArcMap after the generation of a route in route analysis.
To display directions, on the Network Analyst toolbar, click the Directions Window button .
- The Directions Window displays turn-by-turn directions and maps with the impedance.
- If the impedance is set to time, the Directions Window displays the time taken for each segment of the route. Additionally, the Directions Window can display the length of each segment.
- If the route supports time windows, the Directions Window displays the Attr_[time] and Wait_[time] attributes. However, the Violation_[time] and Attr_[length] attributes are not supported.