Make OD Cost Matrix Analysis Layer (Network Analyst)

This ArcGIS 2.8 documentation has been archived and is no longer updated. Content and links may be outdated. See the latest documentation.

Summary

Makes an origin–destination (OD) cost matrix network analysis layer and sets its analysis properties. An OD cost matrix analysis layer is useful for representing a matrix of costs going from a set of origin locations to a set of destination locations. The layer can be created using a local network dataset or a service hosted online or in a portal.

Usage

  • After creating the analysis layer with this tool, you can add network analysis objects to it using the Add Locations tool, solve the analysis using the Solve tool, and save the results on disk using the Save To Layer File tool.

  • When using this tool in geoprocessing models, if the model is run as a tool, the output network analysis layer must be made a model parameter; otherwise, the output layer is not added to the contents of the map.

  • In ArcGIS Pro, network analysis layer data is stored on disk in file geodatabase feature classes. When creating a network analysis layer in a project, the layer's data will be created in a new feature dataset in the Current Workspace environment. When creating a network analysis layer in a Python script, you must first explicitly set the workspace environment to a file geodatabase where you want the layer's data to be stored using arcpy.env.workspace = "<path to file gdb>". When the layer is created, a new feature dataset containing the appropriate sublayer feature classes will be added to this file geodatabase.

Parameters

LabelExplanationData Type
Network Data Source

The network dataset or service on which the network analysis will be performed. Use the portal URL for a service.

Network Dataset Layer;String
Layer Name
(Optional)

The name of the network analysis layer to create.

String
Travel Mode
(Optional)

The name of the travel mode to use in the analysis. The travel mode represents a collection of network settings, such as travel restrictions and U-turn policies, that determine how a pedestrian, car, truck, or other medium of transportation moves through the network. Travel modes are defined on your network data source.

An arcpy.na.TravelMode object and a string containing the valid JSON representation of a travel mode can also be used as input to the parameter.

String
Cutoff
(Optional)

The impedance value at which to stop searching for destinations for a given origin. This value will be in the units of the impedance attribute used by your chosen travel mode. No destinations beyond this limit will be found. This cutoff value can be overridden on a per-origin basis by specifying individual cutoff values in the origins sublayer. By default, no cutoff is used for the analysis.

Double
Number of Destinations to Find
(Optional)

The number of destinations to find per origin. This default can be overridden by specifying an individual value for the TargetDestinationCount property in the origins sublayer. By default, no limit is used, and all destinations are found.

Long
Time of Day
(Optional)

Indicates the departure time from origins.

If you have chosen a traffic-based impedance attribute, the solution will be generated given dynamic traffic conditions at the time of day specified here. A date and time can be specified as 5/14/2012 10:30 AM.

Instead of using a particular date, a day of the week can be specified using the following dates:

  • Today—12/30/1899
  • Sunday—12/31/1899
  • Monday—1/1/1900
  • Tuesday—1/2/1900
  • Wednesday—1/3/1900
  • Thursday—1/4/1900
  • Friday—1/5/1900
  • Saturday—1/6/1900

Date
Time Zone
(Optional)

The time zone of the Time of Day parameter.

  • Local time at locations —The Time of Day parameter refers to the time zone in which the origins are located. This is the default.
  • UTC —The Time of Day parameter refers to Coordinated Universal Time (UTC). Choose this option if you want to calculate your OD cost matrix for a specific time, such as now, but aren't certain in which time zone the origins will be located.
String
Line Shape
(Optional)

No matter which output shape type is chosen, the best route is always determined by the network impedance, never Euclidean distance. This means that only the route shapes are different, not the underlying traversal of the network.

  • No lines — No shape will be generated for the output origin-destination route pair. This is useful when you have a large number of origins and destinations and are interested only in the impedance costs in the OD cost matrix table, not in visualizing your OD cost matrix in a map.
  • Straight lines — The output route shape will be a single straight line between each of the origin-destination pairs. This is the default.
String
Accumulate Attributes
(Optional)

A list of cost attributes to be accumulated during analysis. These accumulated attributes are for reference only; the solver only uses the cost attribute used by your designated travel mode when solving the analysis.

For each cost attribute that is accumulated, a Total_[Impedance] property is populated in the network analysis output features.

This parameter is not available if the network data source is an ArcGIS Online service or the network data source is a service on a version of Portal for ArcGIS that does not support accumulation.

String

Derived Output

LabelExplanationData Type
Network Analyst Layer

The newly created network analysis layer.

Network Analyst Layer

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes