HOW TO

Calculate the shortest network distance using the Origin-Destination (OD) cost matrix solver

Last Published: April 25, 2020

Summary

Instructions provided describe how to calculate the shortest network distance using the Origin-Destination (OD) cost matrix solver.

The OD cost matrix finds and measures the least-cost paths along the network from multiple origins to multiple destinations.

Procedure



  1. Make a new OD cost matrix layer.
  2. Open the attribute table for the Origins layer within the OD cost matrix layer and create a new long field called 'AddressID'. This field stores the unique ID for addresses when they are loaded as origins.
  3. Open the attribute table for the Destination layer within the OD cost matrix layer and create a new long field named 'StopID'. This field stores the stop IDs when they are loaded as destinations.
  4. Load the address as origins using the Add Locations tool.
    Warning:
    For steps four and five, make sure to map the StopID property to the field from the feature class.

  5. Load the mode of transportation (if any) as destination using the Add Locations tool.
  6. Open the properties for the OD cost matrix layer and set the number of destinations, for example, 1, 2, and 3. Set other appropriate analysis settings.
  7. On the Network Analyst toolbar, click Solve the OD cost matrix layer.
  8. In ArcToolbox, open the Join Field tool from the Data Management Tools > Joins toolset.
    Join Field tool

    [O-Image]
  9. Input the following parameters in the indicated fields, and then run the tool:
    • Input Table: OD Cost Matrix\Lines
    • Input Join Field: DestinationID
    • Join Table: Destinations
    • Output Join Field: Object ID
    • Join Fields: StopID (for join field parameter)

    Note:
    This transfers the StopID field from destination to lines.

  10. Run the Join Field tool again to transfer the StopID and the network distance field from line to the feature class containing the address ID.

Article ID:000011028

Software:
  • ArcMap

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options