Skip To Content

OD cost matrix analysis layer

An OD cost matrix analysis layer finds and measures the least-cost paths along the network from multiple origins to multiple destinations. When configuring an OD cost matrix analysis, you can specify the number of destinations to find and a maximum distance to search.

Even though the OD cost matrix solver doesn't output lines that follow the network, the values stored in the Lines attribute table reflect the network distance, not the straight-line distance. The results of OD cost matrix analyses often become input for other spatial analyses in which the network cost is more appropriate than straight-line cost. For example, predicting the movement of people in a built environment is better modeled with network costs, since people tend to travel on roads and pedestrian paths.

Tip:

Consider using the Generate Near Table geoprocessing tool instead if finding the straight-line distances better fits your needs.

Tip:

The closest facility and OD cost matrix solvers perform very similar analyses; the main difference, however, is in the output and the computation speed. OD cost matrix generates results more quickly but cannot return the true shapes of routes or their driving directions. It is designed to quickly solve large M x N problems and, as a result, does not internally contain the information required to generate route shapes and driving directions. Alternatively, the closest facility solver returns routes and directions but performs the analysis more slowly than the OD cost matrix solver. If you need driving directions or true shapes of routes, use the closest facility solver; otherwise, use the OD cost matrix solver to reduce the computation time.

The way to customize an OD cost matrix is by setting properties on an OD cost matrix analysis layer and setting field values on the features classes that make up the analysis layer.

This topic describes the OD cost matrix analysis layer, its analysis properties, and its feature classes.

Origins feature class

This feature class stores the network locations that function as starting points in generating the paths to destinations.

When an OD cost matrix analysis layer is created, the Origins class is empty. It is populated only when network locations are added to it. A minimum of one origin and one destination is required to solve an analysis. The following tables describe the input fields and input/output fields of the Origins feature class:

Origins: 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 network analysis object.

TargetDestinationCount

This property stores the number of destinations that must be found for the origin. If the value for this property is null, the analysis uses the number of destinations to find specified on the OD cost matrix tab for this analysis layer.

Cutoff_[Cost]

(for instance Cutoff_DriveTime, where DriveTime is the travel cost)

This property allows you to limit how far out the OD cost matrix will search for destinations. Any destination beyond the cutoff value will not be considered for this origin.

If the Cutoff_[Cost] is not set for an origin, the analysis will use the default cutoff value specified on the OD cost matrix tab for this analysis layer. If a default cutoff value is not set there either, all destinations will be used for the analysis.

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

This property allows you to specify which side of the vehicle you want the origin to be on when the vehicle departs. You can use the Right side of vehicle (1) or Left side of vehicle (2) value for any analysis that requires the vehicle to depart an origin from one side only. If departing is permitted from either side of the vehicle, use Either side of vehicle (0).

For OD cost matrix analyses, the No U-turn (3) value functions the same as Either side of vehicle.

Origins: Input/output fields

Input/Output fieldDescription

Status

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

  • OK (0)—The origin is valid.
  • Not located (1)—The origin location on the network dataset can't be determined.
  • Network element not located (2)—The network element identified by the origin network location fields can't be found. This can occur when a network element where the origin 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 origin 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 origin field values fall outside the analysis layer's coded or range domains. For example, a negative number may exist where positive numbers are required.
  • Not reached (5)—The origin can't be reached by the solver.
  • Not located on closest (7)—The closest network location to the origin is not traversable because of a restriction or barrier, so the origin has been located on the closest traversable network feature instead.

Destinations feature class

This network analysis class stores the network locations that function as ending points in generating the paths from origins.

When a new OD cost matrix analysis layer is created, the Destinations class is empty. It is populated only when network locations are added to it. A minimum of one origin and one destination is necessary to solve an analysis. The following tables describe the input fields and input/output fields of the Destinations feature class:

Destinations: 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 network analysis object.

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

This property allows you to specify which side of the vehicle you want the destination to be on when the vehicle arrives. You can use the Right side of vehicle (1) or Left side of vehicle (2) value for any analysis that requires the vehicle to arrive at a destination from one side only. If the arrival is permitted from either side of a vehicle, use Either side of vehicle (0).

For OD cost matrix analyses, the No U-turn (3) value functions the same as Either side of vehicle.

Destinations: Input/output fields

Input/Output fieldDescription

Status

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

  • OK (0)—The destination is valid.
  • Not located (1)—The destination location on the network dataset can't be determined.
  • Network element not located (2)—The network element identified by the destination network location fields can't be found. This can occur when a network element where the destination 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 destination 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 destination field values fall outside the analysis layer's coded or range domains. For example, a negative number may exist where positive numbers are required.
  • Not reached (5)—The destination can't be reached by the solver.
  • Not located on closest (7)—The closest network location to the destination is not traversable because of a restriction or barrier, so the destination has been located on the closest traversable network feature instead.

Lines feature class

The Lines feature class stores information about the resulting paths from the origins to the destinations. The Lines class is an output-only class; it is empty until the analysis is complete.

When you choose to display lines in the OD cost matrix analysis layer, they appear as straight lines. However, their cost attributes always report the least-cost network path. The following table describe the output fields of the Lines feature class:

Lines: Output fields

Output 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 network analysis object.

OriginID

The unique ID of the line's associated origin.

DestinationID

The unique ID of the line's associated destination.

DestinationRank

The rank of the destination among all destinations found for the associated origin. The destination that is closest to the origin has a rank of 1.

Total_[Cost]

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

The cumulative cost of traveling along the network between the associated origin and destination. This field is populated for the impedance attribute and any accumulated attributes.

OD cost matrix analysis layer properties

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

OD Cost Matrix tab

Run

Click Run Run, after you load input features and set analysis properties, to solve the OD cost matrix analysis.

Import Origins

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

Import Destinations

Import Destinations Import Destinations is in the Input Data group. Click it to load features from another data source, such as a point feature layer, into the Destinations 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 allows you to choose a travel mode, which is a group of settings that together model the movement of pedestrians, cars, trucks, or another 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.

Cutoff

When calculating the least-cost path from an origin to destinations, the OD cost matrix solver will stop searching for destinations that lie beyond this impedance cutoff. No destinations beyond this limit will be found for that origin. The units you should use for the cutoff value are shown next to the Mode drop-down list.

Note:

Cutoff assigns default values to origins that do not have numeric values stored in the Cutoff_[Impedance] field.

Destinations

You can choose to generate a cost matrix from each origin to all destinations. Alternatively, you can limit the number of destinations to find per origin by entering a value for Destinations.

Note:

The value in Destinations can be overridden on a per-origin basis by specifying an individual value for the TargetDestinationCount property in the origins sublayer.

Arrive Depart Date-Time Type

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

The options in the Arrive Depart Date-Time Type drop-down list are as follows:

  • Not Using Time Not Using Time—Regardless of whether the network data source includes time-based data, the results are based on static travel times—the travel times on a network edge don't vary throughout the day. The Time and Date text boxes are unavailable.

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

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

  • Current Date & Time 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, and both are unavailable so they can't be changed.

  • Day of Week Day of Week—You specify a time of day and day of the week. The Time and Date text boxes are available for you to provide 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 OD cost matrix analysis will always solve least-cost paths along the network, but these network paths cannot be displayed in the map. You can choose to represent the origin-destination path as a straight line if you want to visualize the matrix in the map, or you can choose to not display any lines at all if you're only interested in the costs from the output Lines class table.

Accumulate Cost Attributes

The Accumulate Cost Attributes drop-down menu in the Travel Settings group can be used to configure accumulated cost attributes. The drop-down menu is unavailable if the network data source is a service, the output geometry types do not include lines, or there are no cost attributes. The attributes are grouped by unit domain shown as the group header (for example, Time or Distance). A checked check box indicates that the analysis layer will accumulate the checked attribute during the solve.

Accumulate Cost Attributes drop-down menu

When multiple analysis layers of the same layer type are selected, the check box shows a mixed state if not all layers share the same checked status for one attribute. In the following image, the WeekendFallbackTravelTime attribute is selected for multiple layers, so it has a check mark.

Check box showing a mixed state

If all selected layers share the checked status for an attribute, the check box shows that state.

Check boxes are checked for the attributes