Skip To Content

Route analysis layer

A route analysis layer not only finds shortest paths between stops to output a single route, it can also do the following:

  • Find routes that visit multiple stops in the order you specify.

    Preserved sequence

  • Find routes that optimize the stop sequence to reduce overall travel. This is also known as solving the traveling salesman problem, or TSP.

    Optimally sequenced

    The Sequence property on the Route tab makes it possible to optimize stop order.

  • Generate multiple routes in a single analysis.

    Three output routes

    You can group stops into separate routes using their RouteName field values; one route is generated for each group.

  • Measure travel distances between many pairs of points (origin-destination pairs).

    CommuterTotal Miles

    Steven

    19.9

    Annette

    32.4

    Eli

    24.0

    Sharon

    20.7

    By assigning matching RouteName field values to two stops, they are grouped together and a route is generated for the pair. By doing this for several pairs of stops, you can generate distances for all the origin-destination pairs in a single solve operation.

  • Find the quickest overall route and visit some stops within a certain time of day, such as between 1:00 and 2:00 p.m.

    You can set time windows on stops using their TimeWindowStart and TimeWindowEnd fields.

The way to solve these and other kinds of specialized routing problems is by setting properties on the route analysis layer and setting field values on the feature classes that, together, make up the route analysis layer.

The following describes the route analysis layer, its analysis properties, and its feature classes.

Stops feature class

The Stops feature class initially stores the locations you want the output route or routes to visit. After running the analysis, it stores the locations that were reached by the route, those that weren't (and the reason they weren't reached), and the order in which the stops were visited, as well as other information. The following tables describe the input fields, input/output fields, and output fields of the Stops feature class:

Stops: Input fields

Input fieldDescription

ObjectID

The system-managed ID field.

Shape

The geometry field indicating the geographic location of the network analysis object.

Name

The name of the stop.

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. Stops with the same RouteName value are grouped together.

By using this field, you can group stops into different routes, and the output will attempt to generate one route for each group of stops.

  • If some stops have route names, they are grouped into a route with the same name. If some stops have RouteName values and others do not, those without route names are listed as unassigned in the results and are left out of the solution.
  • If none of the stops have a RouteName value, all the stops belong to the same route and one route is generated.

TimeWindowStart

This field stores the earliest time the stop 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, or street, on which the stop is located.

This field is only available when time windows are enabled on the route analysis layer.

TimeWindowEnd

This field stores the latest time the stop can be visited.

Together, the TimeWindowStart and TimeWindowEnd fieldsmake up the time window within which a route can visit the stop.

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, or street, on which the stop is located.

This field is only available when time windows are enabled on the route analysis layer.

Attr_[Cost]

(for instance, Attr_Minutes, where Minutes is the travel cost)

This field specifies how much additional time spent or distance traveled should occur at the stop.

To determine the units of the field, refer to the units of the network cost attribute specified in the field name. For instance, if there is a DriveTime cost attribute that has a unit of minutes, Attr_DriveTime would be in minutes.

A zero or null value indicates the stop requires no service time or extra distance traveled.

You may want to add additional time on a stop to represent how long it takes to make a delivery, install equipment, or perform some other task at the stop. Similarly, adding extra distance may be useful to account for a long driveway or other road that isn't represented by your network dataset.

If you have multiple network cost attributes, you'll see multiple Attr_[Cost] fields. Consequently, you may have more than one time- or distance-based Attr_[Cost] field. The field values you provide are only referenced if the cost attribute referred to in the field name is used in the analysis, for instance, to minimize or accumulate time or distance..

Network location fields

  • SourceID
  • SourceOID
  • PosAlong
  • SideOfEdge
  • SnapX
  • SnapY
  • SnapZ
  • DistanceToNetworkInMeters

Together, these properties describe the point on the network where the object is located.

CurbApproach

The CurbApproach field 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):

  • Either side of vehicle (0)—The vehicle can approach and depart the stop in either direction. U-turns are allowed. Choose this setting if your vehicle can make a U-turn at the stop or if it can pull into a driveway or parking lot and turn around.
  • Right side of vehicle (1)—When the vehicle approaches and departs the stop, the curb must be on the right side of the vehicle. A U-turn is prohibited.
  • Left side of vehicle (2)—When the vehicle approaches and departs the stop, the curb must be on the left side of the vehicle. A U-turn is prohibited.
  • No U-Turn (3)—When the vehicle approaches the stop, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around.

LocationType

This field describes the stop type.

  • Stop (0)—Represents a location that the route should visit. This is the default.
  • Waypoint (1)—Represents a location that the route should travel through without making a stop. Waypoints can be used to force the route to take a specific path (to go through the waypoint) without being considered an actual stop. Waypoints do not appear in driving directions.
  • Break (2)—Represents a location where the route stops for the driver to take a break.

Note:
  • The time fields in the Stops class can contain either time-only values or date-and-time values. If a time field, such as TimeWindowStart, has a time-only value (for example, 8:00 AM), the date is ignored. Using both date and time (for example, 7/11/2015 8:00 AM) allows you to specify time windows that span multiple days.
  • A time window only states when a vehicle can arrive at a stop, not when the Attr_[Cost] must also be completed. To account for service time and leave before the time window is over, subtract Attr_[Cost] from the TimeWindowEnd field.

Stops: Input/output fields

Input/Output fieldDescription

Sequence

As an input field, this number represents the order in which the stops should be visited. You can use the Sequence parameter on the Route tab to specify whether the output route will follow the sequence specified in this field or override it to generate an optimal sequence that minimizes backtracking.

Within a route (that is, for stops with the same RouteName field value), the sequence number should be greater than 0 but not greater than the total number of stops grouped in the route. Also, the sequence number should not be duplicated among any stops with the same RouteName field value.

Status

This field is constrained by a domain of values, which are listed below (their coded values are shown in parentheses):

  • OK (0)—The stop is valid.
  • Not located (1)—The stop's location on the network dataset can't be determined.
  • Network element not located (2)—The network element identified by the stop's network location fields can't be found. This can occur when a network element where the stop should be was deleted, and the network location was not recalculated.

After running the analysis, the status can be modified to one of the following status values:

  • OK (0)—The network location was successfully evaluated.
  • Element not traversable (3)—The network element that the stop is on is not traversable. This can occur when the network element is restricted by a restriction attribute.
  • Invalid field values (4)—One or more of the stop's field values fall outside the route analysis layer's coded or range domains. For example, a negative number may exist where positive numbers are required.
  • Not reached (5)—The stop can't be reached by the solver. Two stops could be on two different, disconnected portions of the network.
  • Not located on closest (7)—The closest network location to the stop is not traversable because of a restriction or barrier, so the stop has been located on the closest traversable network feature instead.

If time windows are used and the route arrives early or late, the value changes to Time window violation (6).

Stops: Output fields

Output fieldDescription

ArriveCurbApproach

Indicates which side of the vehicle the curb is on when the vehicle approaches the stop. If the stop'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 stop. 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_[Cost]

(for instance, Cumul_Minutes, where Minutes is the cost for the network)

This field is the total time, distance, or other travel cost it takes to reach the stop. This includes the travel cost incurred in traveling to the stop, the cost at the stop, and the costs of all the previous stops.

If a route analysis layer determines it takes 10 minutes to visit two stops, and the second stop has an Attr_Minutes value of 5, the Cumul_Minutes value will be 15 minutes.

Wait_[Cost]

(for instance, Wait_Minutes, where Minutes is the travel cost)

This field stores the time spent waiting for the time window to open (TimeWindowStart) when the route arrives early at the stop.

CumulWait_[Cost]

(for instance, CumulWait_Minutes, where Minutes is the travel cost)

This field stores a sum of how much time has been spent waiting for time windows to open (TimeWindowStart). It measures idle time. It includes the wait time from the current stop and all previous stops visited by the route.

Violation_[Cost]

This field 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 when the route arrived at the stop.

CumulViolation_[Cost]

This field stores the cumulative violation time (Violation_[Cost]) from the current stop and all previous stops visited by the route.

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.

ArriveTimeUTC

The date and time value indicating the arrival time in Coordinated Universal Time (UTC).

DepartTimeUTC

The date and time value indicating the departure time in Coordinated Universal Time (UTC).

Routes feature class

The Routes feature class stores the resulting route, or routes, from the analysis. It is an output-only class; the route analysis layer overwrites or deletes any route features while running the analysis. The following table describes the output fields of the Routes feature class:

Routes: Output fields

Output fieldDescription

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 field of the Stops feature 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, Stop 1 – Stop 8.

Shape

The geometry field indicating the geographic location of the network analysis object.

FirstStopID

The ObjectID value of the route's first stop.

LastStopID

The ObjectID value of the route's last stop.

StopCount

The number of stops visited by the route.

Total_[Cost]

(for instance, Total_Minutes, where Minutes is the travel cost for the network)

The total distance, time, or other travel cost from the beginning of the first stop to the end of the last stop. The total travel cost and the Attr_[Cost] of the visited stops are included in this value.

TotalWait_[Cost]

(for example, TotalWait_Minutes, where Minutes is the travel cost of the network)

This field stores the route's overall wait time, which is the time spent at stops waiting for time windows to open.

TotalViolation_[Cost]

(for example, TotalViolation_Minutes, where Minutes is the travel cost of the network)

This field 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's the difference between the ArriveTime and TimeWindowEnd.

StartTime

The time the route begins.

EndTime

The time the route is complete.

StartTimeUTC

The start time of the route in Coordinated Universal Time (UTC).

EndTimeUTC

The end time of the route in Coordinated Universal Time (UTC).

Route analysis layer properties

The following subsections list parameters you can set on the analysis layer. They are found on the Route tab, which is available only if your route layer or one of its sublayers is selected in the Contents pane.

Route tab

Run

Run Run is in the Analysis group. Click it, after you load input features and set analysis properties, to solve the route analysis.

Import Stops

Import Stops Import Stops is in the Input Data group. Click it to load features from another data source, such as a point feature layer, into the Stops feature class.

Import Barriers

Import Barriers Import Barriers is in the Input Data group. Click it to load features from another data source, such as another feature layer, into one of the barriers feature classes (point barriers, line barriers, or polygon barriers).

Mode

The Mode drop-down list lets you choose a travel mode, which is a group of settings that together model the movement of pedestrians, cars, trucks, or other travel mode. The choices available in the drop-down list depend on the travel modes that are configured on the network data source that the network analysis layer is referencing.

Sequence

The Route solver always finds the shortest path between two stops. However, you can potentially shorten the overall route by letting Network AnalystNetwork Analyst calculate the best stop sequence, which minimizes backtracking. Optimizing stop order is also known as solving the traveling salesman problem, or TSP.

Sequence gives you the following options to preserve all, some, or none of the stop sequences:

  • Use Current Use Current—Preserves the relative stop order specified in the Sequence field of the stops.

    Any stops having null Sequence field values are inserted after those with non-null values.

  • Find Best Find Best—Does not preserve the sequence of any stops, which means the route can begin at any stop location. All stops are reordered to find the shortest possible route.

  • Preserve First & Last Stop Preserve First & Last Stop—The route starts and ends at the first and last stop, respectively. The intermediate stops are reordered to find the shortest possible route.

    If the input stops have a mix of null and non-null Sequence field values, the route begins at the stop with the lowest non-null value and ends at the last stop in the feature class that has a null value.

  • Preserve First Stop Preserve First Stop—The route starts at the first stop. The subsequent stops are reordered to find the shortest possible route.

    If the input stops have a mix of null and non-null Sequence field values, the route begins at the stop with the lowest non-null value and continues to the other stops, which are optimally reordered regardless of whether they have null or non-null values.

  • Preserve Last Stop Preserve Last Stop—The route ends at the last stop. The preceding stops are reordered to find the shortest possible route.

    If the input stops have a mix of null and non-null Sequence field values, the route ends at the last stop in the feature class that has a null value. All preceding stops are reordered for optimality regardless of whether they have null or non-null values.

Type

The Type drop-down list is in the Arrive/Depart Time group and is enabled when the cost units are time based. Use Type to choose whether a specific time and date value is given to indicate at what time the route or routes depart from their first stop. A primary reason for setting a specific time and date is to solve the analysis using dynamic traffic conditions; but to use traffic in the analysis, the network dataset or route service must include traffic data.

  • Not Using Time —Regardless of whether the network data source includes traffic data, the results are based on static travel times—the travel times on a street don't fluctuate throughout the day. The Time and Date text boxes are disabled.

  • Custom Date & Time —You specify the time as a time of day and calendar date. The Time and Date text boxes are enabled for you to enter this information.

  • Today —You specify a time, and the day is assumed to be the current date. The Time text box is enabled for you to enter the time of day, and the Date text box is set to Today and is disabled so it can't be changed.

  • Current Date & Time —When you run the analysis, the time and date are set to the current time and date. This is useful if your network dataset is configured with live traffic data, and the routes are distributed to drivers for implementing immediately after running the analysis. The Time text box is set to Now, and the Date text box is set to Today; both are disabled so they can't be changed.

  • Day of Week —You specify a time of day and day of the week. The Time and Date text boxes are enabled for you to enter this information. Set the day of the week by typing one of the following values into the Date text box:

    • Sunday
    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday

Output Geometry Linear Shape Type

This control allows you to choose how the output will display in the map. The route analysis will always solve least-cost paths along the network using the settings you specify, but in addition to displaying these true paths along the network on the map, you can also choose to represent the routes on a map using simple straight lines between stops or no lines at all.

Directions

Directions Directions is in the Reports group. Click it to generate turn-by-turn directions for each route in the solution.

Share as Route Layers

The Route Layers button Share As Route Layer in the Share As group allows you to share the results from the analysis as route layers. This button opens the Share as Route Layers geoprocessing tool. Upon successful execution, the results from the analysis are shared as route layer items in the portal.