Skip To Content

Retrieve travel modes

Description

The retrieveTravelModes service is used to get the supported travel modes configured in your organization or on the network dataset.

A travel mode is essentially a template consisting of a long list of travel settings that define the physical characteristics of a vehicle or pedestrian. Those characteristics are considered when performing a network analysis to define how the vehicle or pedestrian travels and where it can go. Selecting a predefined travel mode allows you to efficiently and consistently set a number of properties that are appropriate for the mode of travel you intend to model. The benefits are time savings and reduced complexity—you don't need to remember and configure, with each analysis, the parameter values that most accurately characterize the vehicles you're modeling.

An administrator of your organization can configure travel modes to change the properties of the default travel modes in ArcGIS Enterprise, add new travel modes that better reflect your organization’s workflows, or remove travel modes that are not suitable for your organization’s workflows.

To learn more about travel modes, see Configure travel modes.

In ArcGIS Server Manager, if the Use portal travel modes setting is checked, the retrieveTravelModes service will use travel modes configured in your ArcGIS Enterprise portal instead of the travel modes defined on the network dataset used by the service.

Learn more about edit routing service properties

Request parameters

ParameterDetails
token

(Required)

The identity of the user who has permissions to access the service.

f

(Optional)

The response format. The default response format is html.

Values: html | json| pjson

Required parameter

token

Use this parameter to specify a token that provides the identity of a user that has the permissions to access the service. The security and authentication page provides more information about how an access token can be obtained.

Example (replace <yourToken> with a valid token):
token=<yourToken>

Optional parameter

f

Use this parameter to specify the response format. The parameter can have html, json or pjson as arguments, for example, f=json. The pjson value is used for printing the JSON response in a prettified format.

Example usage

You can make a request to retrieve travel modes using the following form:

https://machine.domain.com/webadaptor/rest/services/Routing/NetworkAnalysis/NAServer/Route/retrieveTravelModes?f=json&token=<yourToken>
Note:

The retriveTravelModes operation is on each network analysis layer and the network dataset layer.

Note:

See Implementing App Login for ArcGIS Online and Acquire ArcGIS tokens for ArcGIS Enterprise to learn how to generate one.

JSON Response example

The response below is returned by the retrieveTravelModes service.

Note:

Because the response is quite verbose, the elements in the response are abbreviated for clarity.


{
    "currentVersion": 11.1,
    "defaultTravelMode": "FEgifRtFndKNcJMJ",
    "supportedTravelModes": [
     {
      "attributeParameterValues": [
       {
        "attributeName": "Avoid Private Roads",
        "parameterName": "Restriction Usage",
        "value": "AVOID_MEDIUM"
       },
       {
        "attributeName": "Walking",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Preferred for Pedestrians",
        "parameterName": "Restriction Usage",
        "value": "PREFER_LOW"
       },
       {
        "attributeName": "WalkTime",
        "parameterName": "Walking Speed (km/h)",
        "value": 5
       },
       {
        "attributeName": "Avoid Roads Unsuitable for Pedestrians",
        "parameterName": "Restriction Usage",
        "value": "AVOID_HIGH"
       }
      ],
      "description": "Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.",
      "distanceAttributeName": "Kilometers",
      "id": "caFAgoThrvUpkFBW",
      "impedanceAttributeName": "WalkTime",
      "name": "Walking Time",
      "restrictionAttributeNames": [
       "Avoid Private Roads",
       "Avoid Roads Unsuitable for Pedestrians",
       "Preferred for Pedestrians",
       "Walking"
      ],
      "simplificationTolerance": 2,
      "simplificationToleranceUnits": "esriMeters",
      "timeAttributeName": "WalkTime",
      "type": "WALK",
      "useHierarchy": false,
      "uturnAtJunctions": "esriNFSBAllowBacktrack"
     },
     {
      "attributeParameterValues": [
       {
        "attributeName": "Avoid Private Roads",
        "parameterName": "Restriction Usage",
        "value": "AVOID_MEDIUM"
       },
       {
        "attributeName": "Walking",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Preferred for Pedestrians",
        "parameterName": "Restriction Usage",
        "value": "PREFER_LOW"
       },
       {
        "attributeName": "WalkTime",
        "parameterName": "Walking Speed (km/h)",
        "value": 5
       },
       {
        "attributeName": "Avoid Roads Unsuitable for Pedestrians",
        "parameterName": "Restriction Usage",
        "value": "AVOID_HIGH"
       }
      ],
      "description": "Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel distance.",
      "distanceAttributeName": "Kilometers",
      "id": "yFuMFwIYblqKEefX",
      "impedanceAttributeName": "Kilometers",
      "name": "Walking Distance",
      "restrictionAttributeNames": [
       "Avoid Private Roads",
       "Avoid Roads Unsuitable for Pedestrians",
       "Preferred for Pedestrians",
       "Walking"
      ],
      "simplificationTolerance": 2,
      "simplificationToleranceUnits": "esriMeters",
      "timeAttributeName": "WalkTime",
      "type": "WALK",
      "useHierarchy": false,
      "uturnAtJunctions": "esriNFSBAllowBacktrack"
     },
     {
      "attributeParameterValues": [
       {
        "attributeName": "Avoid Private Roads",
        "parameterName": "Restriction Usage",
        "value": "AVOID_MEDIUM"
       },
       {
        "attributeName": "Driving an Automobile",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Through Traffic Prohibited",
        "parameterName": "Restriction Usage",
        "value": "AVOID_HIGH"
       },
       {
        "attributeName": "TravelTime",
        "parameterName": "Vehicle Maximum Speed (km/h)",
        "value": 0
       },
       {
        "attributeName": "Roads Under Construction Prohibited",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Avoid Gates",
        "parameterName": "Restriction Usage",
        "value": "AVOID_MEDIUM"
       },
       {
        "attributeName": "Avoid Express Lanes",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Avoid Carpool Roads",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       }
      ],
      "description": "Models the movement of cars and other similar small automobiles, such as pickup trucks, and finds solutions that optimize travel time. Travel obeys one-way roads, avoids illegal turns, and    follows other rules that are specific to cars, but does not discourage travel on unpaved roads. When you specify a start time, dynamic travel speeds based on traffic are used where it is available.",
      "distanceAttributeName": "Kilometers",
      "id": "NmNhNDUwZmE1YTlj",
      "impedanceAttributeName": "TravelTime",
      "name": "Rural Driving Time",
      "restrictionAttributeNames": [
       "Avoid Carpool Roads",
       "Avoid Express Lanes",
       "Avoid Gates",
       "Avoid Private Roads",
       "Driving an Automobile",
       "Roads Under Construction Prohibited",
       "Through Traffic Prohibited"
      ],
      "simplificationTolerance": 10,
      "simplificationToleranceUnits": "esriMeters",
      "timeAttributeName": "TravelTime",
      "type": "AUTOMOBILE",
      "useHierarchy": true,
      "uturnAtJunctions": "esriNFSBAtDeadEndsAndIntersections"
     },
     {
      "attributeParameterValues": [
       {
        "attributeName": "Avoid Private Roads",
        "parameterName": "Restriction Usage",
        "value": "AVOID_MEDIUM"
       },
       {
        "attributeName": "Driving an Automobile",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Through Traffic Prohibited",
        "parameterName": "Restriction Usage",
        "value": "AVOID_HIGH"
       },
       {
        "attributeName": "TravelTime",
        "parameterName": "Vehicle Maximum Speed (km/h)",
        "value": 0
       },
       {
        "attributeName": "Roads Under Construction Prohibited",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Avoid Gates",
        "parameterName": "Restriction Usage",
        "value": "AVOID_MEDIUM"
       },
       {
        "attributeName": "Avoid Express Lanes",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       },
       {
        "attributeName": "Avoid Carpool Roads",
        "parameterName": "Restriction Usage",
        "value": "PROHIBITED"
       }
      ],
      "description": "Models the movement of cars and other similar small automobiles, such as pickup trucks, and finds solutions that optimize travel distance. Travel obeys one-way roads, avoids illegal turns,   and follows other rules that are specific to cars, but does not discourage travel on unpaved roads.",
      "distanceAttributeName": "Kilometers",
      "id": "Yzk3NjI1NTU5NjVj",
      "impedanceAttributeName": "Kilometers",
      "name": "Rural Driving Distance",
      "restrictionAttributeNames": [
       "Avoid Carpool Roads",
       "Avoid Express Lanes",
       "Avoid Gates",
       "Avoid Private Roads",
       "Driving an Automobile",
       "Roads Under Construction Prohibited",
       "Through Traffic Prohibited"
      ],
      "simplificationTolerance": 10,
      "simplificationToleranceUnits": "esriMeters",
      "timeAttributeName": "TravelTime",
      "type": "AUTOMOBILE",
      "useHierarchy": true,
      "uturnAtJunctions": "esriNFSBAtDeadEndsAndIntersections"
     },
     ...
    ],
   }

JSON Response syntax

JSON Response syntax for a failed request


{
  "error": {
    "code": <code>,
    "message": "<message>",
    "details": ["<details>"]
  }
}