Calculate Travel Cost

Note:

Calculate Travel Cost was named Connect Origins to Destinations in Map Viewer Classic.

The Calculate Travel Cost tool measures the travel time or distance between pairs of points using either straight lines or network-based travel modes.

The output is a hosted feature layer.

Example

A department store with a rewards program wants to know how far its customers are traveling to shop. An analyst uses the Calculate Travel Cost tool to find the travel distance between each customer (using ZIP Codes for location) and the store.

Travel distance between customer ZIP Codes and the store location

Usage notes

Calculate Travel Cost includes configurations for input layers, analysis settings, and result layers.

Input layers

The Input layers group includes the following parameters:

  • From layer and To layer specify the origin and destination locations between which travel cost is calculated.

    For feature inputs, a count of features is displayed below the layer name. The count includes all features in the layer, except features that have been removed using a filter. Environment settings, such as Processing extent, are not reflected in the feature count.

    The connections created between origins and destinations depend on the numbers of features in the From layer and To layer and are summarized in the following table:

    From layerTo layerConnections

    One feature

    One feature

    The origin connects to the destination.

    One feature

    More than one feature

    The origin connects to all of the destinations.

    More than one feature

    One feature

    All of the origins connect to the destination.

    More than one feature

    More than one feature

    Many-to-many connections are created using matching ID fields. Each origin connects to each destination that has a matching ID field value.

  • From layer route ID field and To layer route ID field specify fields in the From layer and To layer that identify a preassigned origin-destination pair. Each origin connects to a destination that has a matching ID field value. These parameters are available when layers with multiple points are chosen for From layer or To layer.
  • Optional barrier layers is used to add features that act as temporary restrictions when traveling on the underlying streets. The Optional barrier layers parameter includes the following subparameters:
    • Point barrier layer—Point features that block traffic at a specific position along the street. Travel is permitted on the street but not through the barrier. Examples of point barriers include a fallen tree, a traffic accident, or a downed electrical line.
    • Line barrier layer—Line features that block traffic across several street segments. The line barriers prohibit travel anywhere the barriers intersect the streets. Examples of line barriers include a parade or protest.
    • Polygon barrier layer—Polygon features that block traffic across entire areas of the street network. The polygon barriers prohibit travel anywhere the polygon intersects the street. Examples of polygon barriers include a flood or forest fire.

    You can choose a layer using the Layer button, or use the Draw input features button to create a sketch layer to use as the input.

    For feature inputs, a count of features is displayed below the layer name. The count includes all features in the layer, except features that have been removed using a filter. Environment settings, such as Processing extent, are not reflected in the feature count. For line and polygon barriers, support is determined by the number of intersecting streets rather than the count of features.

Analysis settings

The Analysis settings group includes the following parameters:

  • Measurement type is used to choose the method by which travel cost is calculated. The method can be line distance or a travel mode.

    Straight line distances are calculated using a geodesic rather than a Euclidean method. Geodesic lines account for the actual shape of the earth (an ellipsoid, or more properly, a geoid). Distances are calculated between two points on a curved surface (the geoid) as opposed to two points on a flat surface (the Cartesian plane).

    Travel modes are only available if you have the network analysis privilege.

    Learn more about travel modes
  • Departure time specifies the date and time when travel begins to calculate travel costs. This parameter impacts the travel speed for time-based travel modes and impacts the time accumulation for distance-based travel modes. The Departure time parameter options are as follows:
    • Now—Traffic conditions will be based on the current date and time. Live traffic conditions will be used when available.
    • Custom date and time—Traffic conditions will be based on the specified date and time. If the custom date and time is within four hours of the current time, live traffic conditions will be used. If the custom date and time is not within four hours of the current date and time, average historical traffic conditions for the day of week and time of day will be used. Use this option to perform analysis with typical traffic conditions. For example, choose 9:00 a.m. on the previous Monday to perform analysis with typical conditions for Mondays at 9:00 a.m.
    • Time unspecified—Travel speeds will be based on average historical speeds or the posted speed limit.
  • Route shape determines how the output routes appear. The same calculation for travel cost is used regardless of which route shape is chosen. The calculation is always based on the chosen measurement type. The Route shape parameter options are as follows:
    • Straight line generates straight lines (also called desire lines) between the origins and destinations. This is the default.
    • Follow streets generates routes in the shape of the underlying street network. Follow streets is not available when the measurement type is Line distance.

Result layers

The Result layers group includes the following parameters:

  • Output name specifies the name of the layer that is created and displayed. The name must be unique. If a layer with the same name already exists in your organization, the tool will fail and you will be prompted to use a different name.
  • Include route layers saves each result route as a route layer. A route layer includes all the information for a particular route, such as the stops assigned to the route and the travel directions. Creating route layers is useful if you want to share the individual routes with other members in your organization. Click the individual result route on the map to open a pop-up with options to edit, open the route layer, or zoom to the route. The Open route option in the pop-up adds the route layer to the current map.
  • Save in folder specifies the name of a folder in My content where the result will be saved.

Limitations

The following limitations apply to the tool:

  • The maximum number of route layers that can be created is 1,000. If the result contains more than 1,000 routes and Include route layers is checked, only the output feature service will be created.
  • An error will occur if the tool takes more than 240 minutes to run when using travel modes. If this error occurs, try rerunning the analysis with fewer input features or increase the routing geoprocessing service's usage timeout.

Environments

Analysis environment settings are additional parameters that affect a tool's results. You can access the tool's analysis environment settings from the Environment settings parameter group.

This tool honors the Output coordinate system analysis environment.

Credits

Credits will be consumed if your ArcGIS Enterprise portal is configured to use the ArcGIS Online routing services and a travel mode is chosen for Measurement type.

For more information, see Understand credits for spatial analysis.

Outputs

This tool includes the following outputs:

  • One line layer with the lines connecting the origin features to the destination features.
  • One point layer with the unassigned locations in the From layer.
  • One point layer with the unassigned locations in the To layer.
  • One route layer per line (optional).

    Learn more about route layers

Licensing requirements

This tool requires the following user type and configurations:

  • Creator, Professional, or Professional Plus user type
  • Publisher or Administrator role, or an equivalent custom role

The following licensing and routing services are required to use travel modes:

  • Network Analysis privilege
  • Route (Asynchronous)
  • Routing utility service

Learn more about configuring routing services

Resources

Use the following resources to learn more: