Route service with asynchronous execution

The route service can be used to find the best way to get from one location to another or to visit several locations. The best route can be the quickest route for a given time of day considering the traffic conditions applicable during that time, or it can be the shortest route that minimizes the travel distance. The route service can also find the best route that visits each stop during permitted time windows you specify. If you have more than two stops to visit, the best route can be determined for the fixed order of locations you specify. Such a route is called a simple route. Alternatively, the route service can determine the best sequence in which to visit the locations (the traveling salesman problem). Such a route is called an optimized route.

Request URL

You can make a request to the asynchronous route service using the following form:

http://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob?parameters

The Route service supports synchronous and asynchronous execution modes. Asynchronous and synchronous modes define how the application interacts with the service and gets the results.

While the service supports the same general functionality in both execution modes, the choice of the execution mode depends on the type of request your application has to make as well as the size of problem you need to solve using the service. In synchronous mode, the service limits the maximum number of stops to 150. In asynchronous mode, the maximum number of stops is 10,000 and the maximum number of stops per route is 150. So, if you are finding several routes and have fewer than 150 total stops, you can use the synchronous execution mode. However, if your application needs to support more than 150 total stops in a request, you need to use the asynchronous execution mode.

The request URL and the parameter names supported by the service when using synchronous execution are different and described in the Route service with synchronous execution page.

CautionCaution:

The maximum time an application can use the Route service when using the asynchronous execution mode is 1 hour (3,600 seconds). If your request does not complete within this time limit, it will time out and return a failure.

Dive-inDive-in:

The service works in all of the supported countries as listed in the data coverage page. One or more countries are grouped together to form an analysis region. The service can determine the best region to use based on the location of the inputs; otherwise you can use a parameter to specify a region. The service does not support requests that span more than one region. Consequently, the service will only generate results for inputs that fall within one region.

Request parameters

The route request takes the required and options parameters listed below. You need to always include values for the required parameters in your requrests. The optional parameters have default values that are used when not specified in the request.

Required parameters

stops

Use this parameter to specify two or more locations between which the route is to be found.

CautionCaution:

The service imposes a limit of 10,000 points that can be passed as stops. If the value is exceeded, the response returns an error message.

You can specify stop geometries as attributes using a comprehensive JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url property must be specified.
  • features: Specify an array of features. This property is optional. However, either the features or the url property must be specified.

Each feature in the features array represents a stop and contains the following properties:

  • geometry: Specifies the stop geometry as a point containing x and y properties along with a spatialReference property. The spatialReference property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for stops

When specifying the stops using JSON structure, you can specify additional properties for stops, such as their names, using attributes. The stops parameter can be specified with the following attributes:

  • Name: The name of the stop. This name is used when generating driving directions. It is common to pass the name of a business, person, or street address at the stop. If a value is not specified, an autogenerated name such as Location 1 or Location 2 is automatically assigned to each stop.

  • TimeWindowStart: The earliest time the stop can be visited. Specify this attribute if you want to limit when a route can arrive at a stop; for instance, you may want to make deliveries to a restaurant between busy lunch and dinner hours (for example, sometime between 2:00 and 4:30 p.m.) to facilitate the work for you and the restaurant staff.

    The value is specified as an integer that represents the number of milliseconds since epoch (January 1, 1970). Time-window values refer to the time zone in which the stop is located.

    If you specify this attribute, you also need to specify the TimeWindowEnd attribute.

    The time value you enter is associated with a time zone—the time zone in which the stop is located. (Specifically, it is the time zone in which the street closest to the stop is located.) So if your stops span multiple time zones, you will need to set the time values according to where the stops are located.

  • TimeWindowEnd: The latest time the stop can be visited. Together, the TimeWindowStart and TimeWindowEnd attributes make up the time window within which a route can visit the stop. Like TimeWindowStart, the time value is interpreted as the local time zone in which the stop is located (specifically, the time zone in which the street closest to the stop is located).

    The time window specified using TimeWindowStart and TimeWindowEnd attributes is not considered a hard constraint by the service. That is, the service doesn't fail if the stop cannot be visited during the time window; instead, the service tries to find a route that visits the stop during its time window, but if time window violations are inevitable, the service tries to find a solution that minimizes the time-window violation time for all stops in the problem.

    If a route has to arrive early at the stop, a wait time is added to the total travel time of the route. Similarly, if the route arrives late at the stop, a violation time is added to the total travel time of the route. For example, If the time window on the stop is set as 10:00 AM to 11:00 AM and the earliest a route can reach the stop is 11:25 AM, a violation of 25 minutes is added to the total travel time.

  • RouteName: The name of the route to which the stop belongs. Use this attribute to group stops into different routes and, therefore, solve multiple routes in a single request. For example, if you want to find two distinct routes—a route with 4 stops and another with 6 stops—set RouteName to Route1 for each of the four stops and Route2 for each of the 6 stops. The service will produce two distinct routes and driving directions for each group of stops in a single request.

    If RouteName is not specified for any stops, then all stops belong to the same route. If RouteName is not specified for some stops, those stops are treated as unassigned and are not included in any route.

    NoteNote:

    The grouping is entirely based on the provided input, and no attempt is made by the service to group stops in any optimal manner. If you wish to figure out the optimal grouping of stops into routes, you should use the vehicle routing problem service instead.

  • Sequence: If the reorder_stops_to_find_optimal_routes parameter is set to false (its default value), the output routes will visit the stops in the order you specify with this attribute. Within a group of stops that have the same RouteName value, the sequence number should be greater than 0 but not greater than the total number of stops. Also, the sequence number should not be duplicated.

  • CurbApproach: Specifies the direction a vehicle may arrive at and depart from the stop. One of the integers listed in Coded value column in the following table must be specified as a value of this attribute. The values in the Setting column are the descriptive names for CurbApproach attribute values that you might have come across when using ArcGIS Network Analyst extension software.

    Setting

    Coded value

    Description

    Either side of vehicle

    0

    The vehicle can approach and depart the stop in either direction, so a U-turn is allowed at the stop. This is the default value. This setting can be chosen if it is possible and desirable for your vehicle to turn around at the stop. This decision may depend on the width of the road and the amount of traffic or whether the stop has a parking lot where vehicles can pull in and turn around.

    Either side of vehicle
    All arrival and departure combinations are allowed with the Either side of vehicle curb approach.

    Right side of vehicle

    1

    When the vehicle approaches and departs the stop, the stop must be on the right side of the vehicle. A U-turn is prohibited. This is typically used for vehicles like busses that must arrive with the bus stop on the right hand side.

    Right side of vehicle
    The allowed arrival and departure combination for the Right side of vehicle curb approach.

    Left side of vehicle

    2

    When the vehicle approaches and departs the stop, the stop must be on the left side of the vehicle. A U-turn is prohibited. This is typically used for vehicles like busses that must arrive with the bus stop on the left hand side.

    Left side of vehicle
    The allowed arrival and departure combination for the Left side of vehicle curb approach.

    No U-Turn

    3

    When the vehicle approaches the stop, the stop can be on either side of the vehicle; however, when it departs, the vehicle must continue in the same direction it arrived in. A U-turn is prohibited.

    No U-turns
    The allowed arrival and departure combinations for the No U-Turn curb approach.

    The CurbApproach property was designed to work with both kinds of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider a stop on the left side of a vehicle. It is always on the left side regardless of whether the vehicle travels on the left or right half of the road. What may change with national driving standards is your decision to approach from the right or left side. For example, if you want to arrive at a stop and not have a lane of traffic between the vehicle and the stop, you would choose Right side of vehicle in the United States but Left side of vehicle in the United Kingdom.

    Right side of vehicle with right-hand traffic.
    With right-hand traffic, the curb approach that leaves the vehicle closest to the stop is Right side of vehicle.
    Left side of vehicle with left-hand traffic
    With left-hand traffic, the curb approach that leaves the vehicle closest to the stop is Left side of vehicle.

  • AdditionalTime: Specifies the amount of time you expect to spend at the stop. The time is added to the total travel time of the route. The attribute value can be used to model the time spent, for instance, to make a delivery, pick-up, or installation.

    The unit for this attribute value is specified by the measurement_units parameter. The AdditionalTime value is used only if the measurement units are time based. The default value is 0.

  • AdditionalDistance: Specifies the distance to add to the total distance of the route at the stop. Generally, the location of a stop isn't exactly on the street but rather it is set back somewhat from the road. This attribute value can model the distance between the actual incident location and its location on the street if it is important to include that distance in the total travel distance.

    The unit for this attribute value is specified by the measurement_units parameter. The AdditionalDistance value is used only if the measurement units are distance based. The default value is 0.

  • LocationType: Describes the stop type. One of the integers listed in Coded Value column in the following table must be specified as a value of this attribute. The values in the Setting column are the descriptive names for LocationType attribute values that you might have come across when using ArcGIS Network Analyst extension software.

    Setting

    Coded Value

    Description

    Stop

    0

    A location that the route should visit. This is the default.

    Waypoint

    1

    A location that the route should travel through without making a stop. Waypoints can be used to force the route to take a specific path (to go through the waypoint) without being considered an actual stop. Waypoints do not appear in driving directions.

Syntax for specifying stops using JSON structure for features
{
    "features": [
        {
            "geometry": {
                "x": <x>,
                "y": <y>,
                "spatialReference": {
                    "wkid": <wkid>,
                    "latestWkid": <wkid>,
                    
                }
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                "x": <x>,
                "y": <y>,
                "spatialReference": {
                    "wkid": <wkid>,
                    "latestWkid": <wkid>,
                    
                }
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ], 
}
Syntax for specifying stops using URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying stop geometries and attributes using JSON structure

The geometries for stops are in the default spatial reference, WGS84, and therefore the spatialReference property is not required within the geometry property. The example also shows how to specify the Name attribute for each stop and group four stops into two routes, Route A and Route B, using the RouteName attribute.

{
    "features": [
        {
            "geometry": {
                "x": -122.4079,
                "y": 37.78356
            },
            "attributes": {
                "Name": "From",
                "RouteName": "Route A"
            }
        },
        {
            "geometry": {
                "x": -122.404,
                "y": 37.782
            },
            "attributes": {
                "Name": "To",
                "RouteName": "Route A"
            }
        },
        {
            "geometry": {
                "x": -122.4095,
                "y": 37.78379
            },
            "attributes": {
                "Name": "From",
                "RouteName": "Route B"
            }
        },
        {
            "geometry": {
                "x": -122.480,
                "y": 37.734
            },
            "attributes": {
                "Name": "To",
                "RouteName": "Route B"
            }
        }
    ]
}
Example 2: Specifying stop geometries in Web Mercator spatial reference using JSON structure.

The stops geometries are in the Web Mercator spatial reference and not in the default WGS84 spatial reference. Therefore, the spatialReference property is required within the geometry property.

{
    "features": [
        {
            "geometry": {
                "x": -13635398.9398,
                "y": 4544699.034400001,
                "spatialReference": {
                    "wkid": 102100
                }
            },
            "attributes": {
                "Name": "Home",
            }
        },
        {
            "geometry": {
                "x": -13632733.3441,
                "y": 4547651.028300002,
                "spatialReference": {
                    "wkid": 102100
                }
            },
            "attributes": {
                "Name": "Office",
            }
        }
    ]
}
Example 3: Specifying stops using URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/1/query?where=1%3D1&outFields=Name,RouteName&f=json"
}

token

Use this parameter to specify a token that provides the identity of a user that has the permissions to access the service. Accessing services provided by Esri provides more information on how such an access token can be obtained.

f

Use this parameter to specify the response format. Choose either json or pjson, for example, f=json. The pjson value is used for printing the JSON response in a pretty format.

Optional parameters

travel_mode

Choose the mode of transportation for the analysis.

Travel modes are managed in ArcGIS Online and can be configured by the administrator of your organization to better reflect your organization's workflows. You need to specify the JSON object containing the settings for a travel mode supported by your organization. To get a list of supported travel modes, execute the GetTravelModes tool from the Utilities service.

The value for the travel_mode parameter should be a JSON object representing travel mode settings. When you use the GetTravelModes tool from the Utlities service, You get a string representing the travel mode JSON. You need to convert this string to a valid JSON object using your API and then pass the JSON object as the value for the travel_mode parameter.

For example, below is a string representating the Walking Time travel mode as returned by the GetTravelModes tool.

"{\"attributeParameterValues\": [{\"parameterName\": \"Restriction Usage\", \"attributeName\": \"Walking\", \"value\": \"PROHIBITED\"}, {\"parameterName\": \"Restriction Usage\", \"attributeName\": \"Preferred for Pedestrians\", \"value\": \"PREFER_LOW\"}, {\"parameterName\": \"Walking Speed (km/h)\", \"attributeName\": \"WalkTime\", \"value\": 5}], \"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.\", \"impedanceAttributeName\": \"WalkTime\", \"simplificationToleranceUnits\": \"esriMeters\", \"uturnAtJunctions\": \"esriNFSBAllowBacktrack\", \"restrictionAttributeNames\": [\"Preferred for Pedestrians\", \"Walking\"], \"useHierarchy\": false, \"simplificationTolerance\": 2, \"timeAttributeName\": \"WalkTime\", \"distanceAttributeName\": \"Miles\", \"type\": \"WALK\", \"id\": \"caFAgoThrvUpkFBW\", \"name\": \"Walking Time\"}"

The above value should be converted to a valid JSON object and passed as the value for the travel_mode parameter

travel_mode={"attributeParameterValues":[{"parameterName":"Restriction Usage","attributeName":"Walking","value":"PROHIBITED"},{"parameterName":"Restriction Usage","attributeName":"Preferred for Pedestrians","value":"PREFER_LOW"},{"parameterName":"Walking Speed (km/h)","attributeName":"WalkTime","value":5}],"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.","impedanceAttributeName":"WalkTime","simplificationToleranceUnits":"esriMeters","uturnAtJunctions":"esriNFSBAllowBacktrack","restrictionAttributeNames":["Preferred for Pedestrians","Walking"],"useHierarchy":false,"simplificationTolerance":2,"timeAttributeName":"WalkTime","distanceAttributeName":"Miles","type":"WALK","id":"caFAgoThrvUpkFBW","name":"Walking Time"}

The default value,Custom, allows you to configure your own travel mode. When you pass in Custom, you can set values for the following parameters impedance, uturn_at_junctions, use_hierarchy, route_line_simplification_tolerance, restrictions, and attribute_parameter_values.

The default values of the custom travel mode parameters model travelling by car. You may want to choose Custom and set the custom travel mode parameters listed above to model a pedestrian with a fast walking speed or a truck with a given height, weight, and cargo of certain hazardous materials. You may choose to do this to try out different settings to get desired analysis results. Once you have identified the analysis settings, you should work with your organization's administrator and save these settings as part of new or existing travel mode so that everyone in your organization can rerun the analysis with the same settings.

CautionCaution:

When the travel_mode parameter is not set to Custom, this means you are choosing a travel mode configured by your organization, and the service automatically overrides the values of other parameters with values that model the chosen travel mode. The following parameters are overridden:impedance, uturn_at_junctions, use_hierarchy, route_line_simplification_tolerance, restrictions, and attribute_parameter_values.

If you set travel_mode to Custom, the service honors the default or user-defined values for the related parameters (impedance, uturn_at_junctions, use_hierarchy, route_line_simplification_tolerance, restrictions, and attribute_parameter_values) so you can create your own travel mode.

measurement_units

Use this parameter to specify the units that should be used to report the total travel time or travel distance for the output routes. The service determines the shortest path based on travel time or travel distance along the streets depending on whether the units you specify for this parameter are time or distance based. The parameter can be specified using the following values:

  • Meters
  • Kilometers
  • Feet
  • Yards
  • Miles
  • Nautical Miles
  • Seconds
  • Minutes
  • Hours
  • Days

The default value is Minutes.

analysis_region

Specify the region in which to perform the analysis. If a value is not specified for this parameter, the tool will automatically calculate the region name based on the location of the input points. Setting the name of the region is recommended to speed up the tool execution. To specify a region, use one of the following values:

  • Europe
  • Greece
  • India
  • Japan
  • Korea
  • MiddleEastAndAfrica
  • NorthAmerica
  • Oceania
  • SouthAmerica
  • SouthAsia
  • SouthEastAsia
  • Taiwan
  • Thailand

The data coverage page lists the countries that are grouped into each of these regions.

reorder_stops_to_find_optimal_routes

Use this parameter to specify whether the service should reorder stops to find the optimized route.

  • false—The service returns a route that visits stops in the order you define. This is the default value.

  • true—The service finds the best order to visit the stops. The service will account for a variety of variables so that the total travel distance or travel time for the route is minimized. You can elect to preserve the first and last stops while allowing the service to reorder intermediary stops by setting the preserve_terminal_stops parameter.

CautionCaution:

A true parameter value causes the service to switch from solving a shortest-path problem to a traveling salesperson problem (TSP). Solving a TSP is a computer-intensive operation and incurs additional service credits per route.

preserve_terminal_stops

When reorder_stops_to_find_optimal_routes is checked (or True), you have options to preserve the starting or ending stops and let the tool reorder the rest. The first and last stops are determined by their Sequence attribute values or, if the Sequence values are null, by the order they are listed.

  • Preserve First—The service won't reorder the first stop. Choose this option if you are starting from a known location, such as your home, headquarters, or current location. This is the default value.

  • Preserve Last—The service won't reorder the last stop. The output routes may begin at any stop but must end at the predetermined last stop.

  • Preserve First and Last—The tool won't reorder the first and last stops.

  • Preserve None—The service may reorder any stop, including the first and last stops. The route may start or end at any of the stop features.

This parameter is ignored when reorder_stops_to_find_optimal_routes is false.

return_to_start

Choose whether routes should start and end at the same location. With this option you can avoid duplicating the first stop feature and sequencing the duplicate stop at the end of the stop list.

  • true—The route should start and end at the first stop feature. This is the default value.

    When reorder_stops_to_find_optimal_routes and return_to_start are both true, preserve_terminal_stops must be set to Preserve First (the default value).

  • false—The route won't start and end at the first stop feature.

use_time_windows

Set this parameter to true if the routes should consider any time windows specified on the input stops. Otherwise, set it to false, which is the default value.

You can add time windows to input stops by entering time values in the TimeWindowStart and TimeWindowEnd attributes.

The tool will take slightly longer to run when use_time_windows is true, even when none of the input stops have time windows, so it is recommended to set it to false if possible.

time_zone_for_time_windows

Use this parameter to specify the time zone for the time window values on stops. The time windows are specified as part of TimeWindowStart and TimeWindowEnd fields on stops. This parameter is applicable only when the use_time_windows parameter is set to true.

The parameter can be specified using one of the following values:

  • Geographically Local — The time window values associated with the stops are in the time zone in which the stops are located. For example, if the stop is located in an area that follows Eastern Standard Time and has time window values of 8 AM and 10 AM, the time window values will be treated as 8 AM and 10 AM in Eastern Standard Time.
  • UTC — The time window values associated with the stops are in the Coordinated Universal Time (UTC). For example, if the stop is located in an area that follows Eastern Standard Time and has time window values of 8 AM and 10 AM, the time window values will be treated as 12 PM and 2 PM Eastern Standard Time assuming the Eastern Standard Time is obeying the Daylight Saving Time. Specifying the time window values in UTC is useful if you do not know the time zone in which the stops are located or when you have stops in multiple time zones and you want all the time windows to start simultaneously. The UTC option is applicable only when your network dataset defines a time zone attribute. If your network dataset does not define a time zone attribute, then all time window values are always treated as GEO_LOCAL.

The default value for this parameter is Geographically Local.

time_of_day

Specifies the time and date at which the routes should begin. If you specify the current date and time as the value for this parameter, the tool will use live traffic conditions to find the best routes and the total travel time will be based on traffic conditions where available. (See the data coverage page for details on which areas support traffic.)

The time is specified as Unix time (milliseconds since midnight, January 1 1970).

The time_zone_for_time_of_day parameter specifies whether time_of_day refers to UTC or the time zone in which the stop is located.

The tool ignores this parameter when measurement_units isn't set to a time-based unit.

Specifying a time of day results in more accurate routes and estimations of travel times because the travel times account for the traffic conditions that are applicable for that date and time.

If a time of day is not passed in, the service uses static road speeds based on average historical speeds or posted speed limits. It uses posted speeds in areas where historical traffic information isn't available.

NoteNote:

Traffic is supported only with the driving time impedance or travel mode. It's not supported with trucking.

The service supports two kinds of traffic: typical and live. Typical traffic references travel speeds that are made up of historical averages for each five-minute interval spanning a week. Live traffic retrieves speeds from a traffic feed that processes phone probe records, sensors, and other data sources to record actual travel speeds and predict speeds for the near future.

The Data Coverage page shows the countries Esri currently provides traffic data for.

Typical Traffic:

To ensure the service uses typical traffic in locations where it is available, choose a time and day of the week, and then convert the day of the week to one of the following dates from 1990:

  • Monday—1/1/1990
  • Tuesday—1/2/1990
  • Wednesday—1/3/1990
  • Thursday—1/4/1990
  • Friday—1/5/1990
  • Saturday—1/6/1990
  • Sunday—1/7/1990

Set the time and date as Unix time in milliseconds.

For example, to solve for 1:03 p.m. on Thursdays, set the time and date to 1:03 p.m., 4 January 1990; and convert to milliseconds (631458180000).

NoteNote:

Although the dates representing days of the week are from 1990, typical traffic is calculated from recent traffic trends—usually over the last several months.

Live Traffic:

To use live traffic when and where it is available, choose a time and date and convert to Unix time.

Esri saves live traffic data for 12 hours and references predictive data extending 12 hours into the future. If the time and date you specify for this parameter is outside the 24-hour time window, or the travel time in the analysis continues past the predictive data window, the task falls back to typical traffic speeds.

Examples:

  • "time_Of_Day": 631458180000 // 13:03, 4 January 1990. Typical traffic on Thursdays at 1:03 p.m.
  • "time_Of_Day": 631731600000 // 17:00, 7 January 1990. Typical traffic on Sundays at 5:00 p.m.
  • "time_Of_Day": 1413964800000 // 8:00, 22 October 2014. If the current time is between 8:00 p.m., 21 Oct. 2014 and 8:00 p.m., 22 Oct. 2014, live traffic speeds are referenced in the analysis; otherwise, typical traffic speeds are referenced.
  • "time_Of_Day": 1426674000000 // 10:20, 18 March 2015. If the current time is between 10:20 p.m., 17 Mar. 2015 and 10:20 p.m., 18 Mar. 2015, live traffic speeds are referenced in the analysis; otherwise, typical traffic speeds are referenced.

time_zone_for_time_of_day

Specifies the time zone of the time_of_day parameter.

  • Geographically Local—The time_of_day parameter refers to the time zone in which the first stop of a route is located.

    If you are generating many routes that start in multiple times zones, the start times are staggered in Coordinated Universal Time (UTC). For example, a time_of_day value of 10:00 a.m. would mean a start time of 10:00 a.m. Eastern Time (4:00 p.m. UTC) for routes beginning in the Eastern Time Zone and 10:00 a.m. Central Time (5:00 p.m. UTC) for routes beginning in the Central Time Zone. The start times are offset by one hour in UTC.

    The arrive and depart times and dates recorded in the output Stops will refer to the local time zone of the first stop for each route.

  • UTC—The time_of_day parameter refers to Coordinated Universal Time (UTC). Choose this option if you want to generate a route for a specific time, such as now, but aren't certain in which time zone the first stop will be located.

    If you are generating many routes spanning multiple times zones, the start times in UTC are simultaneous. For example, a time_of_day value of 10:00 a.m. would mean a start time of 5:00 a.m. Eastern Time (UTC-5:00) for routes beginning in the Eastern Time Zone and 4:00 a.m. Central Time (UTC-6:00) for routes beginning in the Central Time Zone. Both routes would start at 10:00 a.m. UTC.

    The arrive and depart times and dates recorded in the output Stops feature class will refer to UTC.

uturn_at_junctions

Use this parameter to restrict or allow the analysis to make U-turns at junctions.

CautionCaution:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

In order to understand the available parameter values, consider for a moment that a junction is a point where only two streets intersect each other. If three or more streets intersect at a point, it is called as an intersection. A cul-de-sac is a dead-end. The parameter can have the following values:

Parameter Value

Description

Allowed

U-turns are permitted everywhere. Allowing U-turns implies that the vehicle can turn around at a junction or intersection and double back on the same street.

U-turns are allowed
U-turns are permitted at junctions with any number of adjacent streets.

Allowed only at Intersections and Dead Ends

U-turns are prohibited at junctions where exactly two adjacent streets meet.

U-turns allowed only at intersections and dead-ends
U-turns are permitted only at intersections or dead ends.

Allowed only at Dead Ends

U-turns are prohibited at all junctions and interesections and are permitted only at dead ends.

U-turns allowed only at dead-ends
U-turns are permitted only at dead ends.

Not Allowed

U-turns are prohibited at all junctions, intersections, and dead-ends. Note that even when this parameter value is chosen, a route can still make U-turns at stops. If you wish to prohibit U-turns at a stop, you can set its CurbApproach property to the appropriate value (3).

The default value for this parameter is Allowed.

point_barriers

Use this parameter to specify one or more points that act as temporary restrictions or represent additional time or distance that may be required to travel on the underlying streets. For example, a point barrier can be used to represent a fallen tree along a street or time delay spent at a railroad crossing.

CautionCaution:

The service imposes a maximum limit of 250 point barriers. If the value is exceeded, the response returns an error message.

The point_barriers parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the geometries of point barriers. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a point barrier and contains the following properties:

  • geometry: Specifies the barrier's geometry as a point containing x and y properties.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for point_barriers

When specifying the point_barriers parameter you can specify additional information about barriers, such as the barrier type, using attributes. The point_barriers parameter can be specified with the following attributes:

  • Name: The name of the barrier.
  • BarrierType: Specifies whether the point barrier restricts travel completely or adds time or distance when it is crossed. The value for this attribute is specified as one of the following integers:
    • 0 - Prohibits traversing through the barrier. The barrier is referred to as restriction point barrier since it acts as a restriction. This is the default value.
      Two maps demonstrate how a restriction point barrier affects finding the best route.
      The map on the left shows the shortest path between two stops without any restriction point barriers. The map on the right has a road that is blocked by a fallen tree, so the shortest path between the same points is longer.
    • 2 - Traveling through the barrier increases the travel time or distance by the amount specified as the value for Additional_Time or Additional_Distance attributes. This barrier type is referred to as an added cost point barrier.
      Two maps demonstrate how added cost barriers affect finding the best route.
      The map on the left shows the shortest path between two stops without any added cost point barrier. For the map on the right, the travel time from stop one to stop two would be the same whether going around the north end of the block or the south end; however, since crossing railroad tracks incurs a time penalty (modeled with added cost point barriers), the route with only one railroad crossing is chosen. The cost of crossing the barrier is added to the accumulated travel time of the resulting route.
      NoteNote:

      There is no point barrier type with a value of 1 for the BarrierType attribute.

  • Additional_Time: Indicates how much travel time is added when the barrier is traversed. This attribute is applicable only for added-cost barriers and only if the measurement units are time based. The attribute value must be greater than or equal to zero and is specified in the measurement units.
  • Additional_Distance: Indicates how much distance is added when the barrier is traversed. This attribute is applicable only for added-cost barriers and only if the measurement units are distance based. The attribute value must be greater than or equal to zero and is specified in the measurement units.

Syntax for specifying point_barriers using a JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>, 
    },
    "features": [
        {
            "geometry": {
                "x": <x1>,
                "y": <y1>,
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                "x": <x2>,
                "y": <y2>,
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ], 
}
Syntax for specifying point_barriers using a URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying an added cost point barrier in the default spatial reference, WGS84, using JSON structure.

This example shows how to use an added cost point barrier to model a 5-minute delay at a railroad crossing. The BarrierType attribute is used to specify the point barrier is of type added cost and the Additional_Time attribute is used to specify the added delay in minutes. The barrier geometries are in the default spatial reference, WGS84. Hence, the spatialReference property is not specified.

{
    "features": [
        {
            "geometry": {
                "x": 37.541479,
                "y": -122.053461
            },
            "attributes": {
                "Name": "Haley St railroad crossing",
                "BarrrierType": 2,
                "Additional_Time": 5
            }
        }
    ]
}
Example 2: Specifying restriction point barriers in the Web Mercator spatial reference using a JSON structure.

This example shows how to use a restriction point barrier to model a road that is blocked by a fallen tree.The barrier's geometry is in the Web Mercator spatial reference and not in the default WGS84 spatial reference. Hence, the spatialReference property is required.

{
    "spatialReference": {
        "wkid": 102100
    },
    "features": [
        {
            "geometry": {
                "y": -13635398.9398,
                "x": 4544699.034400001
            },
            "attributes": {
                "Name": "Fallen tree at 123 Main St", 
                "BarrierType": 0
            }
        }
    ]
}
Example 3: Specifying point barriers using a URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/MapServer/21/query?where=1%3D1&outFields=Name&f=json"
}

line_barriers

Use this parameter to specify one or more lines that prohibit travel anywhere the lines intersect the streets. For example, a parade or protest that blocks traffic across several street segments can be modeled with a line barrier. A line barrier can also quickly fence off several roads from being traversed, thereby channeling possible routes away from undesirable parts of the street network.

Two maps demonstrate how a line barrier affects finding a route between two stops.
The map on the left displays the shortest path between two stops. The map on the right shows the shortest path when several streets are blocked by a line barrier.

CautionCaution:

The service imposes a limit on the number of streets you can restrict using the line_barriers parameter. While there is no limit on number of lines you can specify as line barriers, the combined number of streets intersected by all the lines cannot exceed 500. If the value is exceeded, the response returns an error message.

The line_barriers parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the geometries of the barriers. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a line barrier and contains the following properties:

  • geometry: Specifies the barrier's geometry. The structure is based on ArcGIS REST polyline object. A polyline contains an array of paths. Each path is represented as an array of points, and each point in the path is represented as an array of numbers containing X and Y coordinate values at index 0 and 1 respectively.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for line_barriers

The line_barriers parameter can be specified with the following attributes:

  • Name: The name of the line barrier.

Syntax for specifying line barriers using a JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>, 
    },
    "features": [
        {
            "geometry": {
                "paths": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
		{
            "geometry": {
                "paths": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ], 
}
Syntax for specifying line barriers using a URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying line barriers using a JSON structure in Web Mercator spatial reference.

The example shows how to add two lines as line barriers to restrict travel on the streets intersected by the lines. Barrier 1 is a single-part line feature made up of two points. Barrier 2 is a two-part line feature whose first part is made up of three points and whose second part is made up of two points. The barrier geometries are in the Web Mercator spatial reference and not in the default WGS84 spatial reference. Hence, the spatialReference property is required.

{
    "spatialReference": {
        "wkid": 102100
    },
    "features": [
        {
            "geometry": {
                "paths": [
                    [
                        [
                            -10804823.397,
                            3873688.372
                        ],
                        [
                            -10804811.152,
                            3873025.945
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Barrier 1"
            }
        },
        {
            "geometry": {
                "paths": [
                    [
                        [
                            -10804823.397,
                            3873688.372
                        ],
                        [
                            -10804807.813,
                            3873290.911
                        ],
                        [
                            -10804811.152,
                            3873025.945
                        ]
                    ],
                    [
                        [
                            -10805032.678,
                            3863358.76
                        ],
                        [
                            -10805001.508,
                            3862829.281
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Barrier 2"
            }
        }
    ]
}
Example 2: Specifying line barriers using URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/6/query?where=1%3D1&returnGeometry=true&f=json"
}

polygon_barriers

Use this parameter to specify polygons that either completely restrict travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

CautionCaution:

The service imposes a limit on the number of streets you can restrict using the polygon_barriers parameter. While there is no limit on number of polygons you can specify as the polygon barriers, the combined number of streets intersected by all the polygons cannot exceed 2,000. If the value is exceeded, the response returns an error message.

The polygon_barriers parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • spatialReference: Specifies the spatial reference for the geometries of barriers. This property is not required if the coordinate values are in the default spatial reference, WGS84. If the coordinate values are in a different spatial reference, you need to specify the well-known ID (WKID) for the spatial reference. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents a polygon barrier and contains the following properties:

  • geometry: Specifies the barrier's geometry. The structure is based on ArcGIS REST polygon object. A polygon contains an array of rings. The first point of each ring is always the same as the last point. Each point in the ring is represented as an array of numbers containing X and Y coordinate values at index 0 and 1 respectively.
  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.

Attributes for polygon_barriers

When specifying the polygonBarriers parameter, you can specify additional information about barriers, such as the barrier type, using attributes. The polygon_barriers parameter can be specified with the following attributes:

  • Name: The name of the barrier.
  • BarrierType: Specifies whether the barrier restricts travel completely or scales the time or distance for traveling through it. The value for this attribute is specified as one of the following integers:
    • 0 - Prohibits traveling through any part of the barrier. The barrier is referred to as restriction polygon barrier since it prohibits traveling on streets intersected by the barrier. One use of this type of barrier is to model floods that make traveling on flooded streets impossible. This is the default value.
      Two maps demonstrate how a restriction polygon barrier affects finding a route between two stops.
      The left side depicts the shortest path between two stops. On the right, a polygon barrier blocks flooded streets, so the shortest path between the same two stops is different.
    • 1 - Scales the time or distance required to travel the underlying streets by a factor specified using the ScaledTimeFactor or ScaledDistanceFactor attributes. If the streets are partially covered by the barrier, the travel time or distance is apportioned and then scaled. For example, a factor 0.25 would mean that travel on underlying streets is expected to be four times faster than normal. A factor of 3.0 would mean it is expected to take three times longer than normal to travel on underlying streets. This barrier type is referred to as scaled cost polygon barrier. It might be used to model storms that reduce travel speeds in specific regions.
      Two maps demonstrate how a scaled cost polygon barrier affects finding a route between two stops.
      The map on the left shows a route that goes through inclement weather without regard for the effect poor road conditions have on travel time. On the right, a scaled polygon barrier doubles the travel time of the roads covered by the storm. Notice the route still passes through the southern tip of the storm since it is quicker to spend more time driving slowly through a small part of the storm rather than driving completely around it. The service uses the modified travel time in calculating the best route; furthermore, the modified travel time is reported as the total travel time in the response.
  • ScaledTimeFactor: This is the factor by which the travel time of the streets intersected by the barrier is multiplied. This attribute is applicable only to scaled-cost barriers whose measurement units are time based. The attribute value must be greater than zero. The default value is 1.
  • ScaledDistanceFactor: This is the factor by which the distance of the streets intersected by the barrier is multiplied. This attribute is applicable only to scaled-cost barriers whose measurement units are distance based. The attribute value must be greater than zero. The default value is 1.

Syntax for specifying polygon barriers using a JSON structure for features
{
    "spatialReference": {
        "wkid": <wkid>,
        "latestWkid": <wkid>    
    }
    "features": [
        {
            "geometry": {
                "rings": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ],
                        ...,
                        [
                            <x11>,
                            <y11>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ],
                        ...,
                        [
                            <x21>,
                            <y21>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>
            }
        },
        {
            "geometry": {
                "rings": [
                    [
                        [
                            <x11>,
                            <y11>
                        ],
                        [
                            <x12>,
                            <y12>
                        ],
                        ...,
                        [
                            <x11>,
                            <y11>
                        ]
                    ],
                    [
                        [
                            <x21>,
                            <y21>
                        ],
                        [
                            <x22>,
                            <y22>
                        ],
                        ...,
                        [
                            <x21>,
                            <y21>
                        ]
                    ]
                ]
            },
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>
            }
        }
    ]
}
Syntax for specifying polygon barriers using a URL returning a JSON response
{
    "url": "<url>"
}
Example 1: Specifying polygon barriers using a JSON structure.

The example shows how to add two polygons as barriers. The first polygon named Flood zone is a restriction polygon barrier that prohibits travel on the underlying streets. The polygon is a single-part polygon feature made up of four points. The second polygon named Severe weather zone is a scaled-cost polygon barrier that increases the travel time on underlying streets to one third of the original value. The polygon is a two-part polygon feature. Both parts are made up of four points.

The barrier geometries are in the default spatial reference, WGS84. Hence, the spatialReference property is not required.

{
    "features": [
        {
            "geometry": {
                "rings": [
                    [
                        [
                            -97.0634,
                            32.8442
                        ],
                        [
                            -97.0554,
                            32.84
                        ],
                        [
                            -97.0558,
                            32.8327
                        ],
                        [
                            -97.0638,
                            32.83
                        ],
                        [
                            -97.0634,
                            32.8442
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Flood zone",
                "BarrierType": 0
            }
        },
        {
            "geometry": {
                "rings": [
                    [
                        [
                            -97.0803,
                            32.8235
                        ],
                        [
                            -97.0776,
                            32.8277
                        ],
                        [
                            -97.074,
                            32.8254
                        ],
                        [
                            -97.0767,
                            32.8227
                        ],
                        [
                            -97.0803,
                            32.8235
                        ]
                    ],
                    [
                        [
                            -97.0871,
                            32.8311
                        ],
                        [
                            -97.0831,
                            32.8292
                        ],
                        [
                            -97.0853,
                            32.8259
                        ],
                        [
                            -97.0892,
                            32.8279
                        ],
                        [
                            -97.0871,
                            32.8311
                        ]
                    ]
                ]
            },
            "attributes": {
                "Name": "Severe weather zone",
                "BarrierType": 1,
                "ScaledTimeFactor": 3
            }
        }
    ]
}
Example 2: Specifying a polygon barrier using a URL.

The URL makes a query for a few features from a map service. A URL querying features from a feature service can also be specified.

{
    "url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/7/query?where=1%3D1&returnGeometry=true&f=json"
}

use_hierarchy

Specify whether hierarchy should be used when finding the shortest paths.

CautionCaution:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

  • true—Use hierarchy when measuring between points. This is the default value. When hierarchy is used, the tool prefers higher-order streets (such as freeways) to lower-order streets (such as local roads), and can be used to simulate the driver preference of traveling on freeways instead of local roads even if that means a longer trip. This is especially true when finding routes to faraway locations, because drivers on long-distance trips tend to prefer traveling on freeways where stops, intersections, and turns can be avoided. Using hierarchy is computationally faster, especially for long-distance routes, since the tool can determine the best route from a relatively smaller subset of streets.

  • false—Do not use hierarchy when measuring between stops. If hierarchy is not used, the tool considers all the streets and doesn't prefer higher-order streets when finding the route. This is often used when finding short-distance routes within a city.

CautionCaution:

The service automatically reverts to using hierarchy if the straight-line distance between the stops is greater than 50 miles (80.46 kilometers), even if you have specified to find the route without using hierarchy.

restrictions

Use this parameter to specify which restrictions should be honored by the service. A restriction represents a driving preference or requirement. In most cases, restrictions cause roads or pathways to be prohibited, but they can also cause them to be avoided or preferred. For instance, using an Avoid Toll Roads restriction will result in a route that will include toll roads only when it is absolutely required to travel on toll roads in order to visit a stop. Height Restriction makes it possible to route around any clearances that are lower than the height of your vehicle. If you are carrying corrosive materials on your vehicle, using the Any Hazmat Prohibited restriction prevents hauling the materials along roads where it is marked as illegal to do so.

CautionCaution:

The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

The service supports the restriction names listed in the following table:

NoteNote:

Some restrictions are supported only in certain countries as indicated by the Availability column in the table. A restriction is supported in a country if the Logistics Attribute column has a value of Yes in the list of supported countries. If you specify restriction names that are not available in the country where your input points are located, the service ignores the invalid restrictions and returns warning messages indicating the names for the restrictions that were not considered when making measurements.

NoteNote:

Sometimes you need to specify an additional value, the restriction attribute parameter, on a restriction to get the intended results. This value needs to be associated with the restriction name and a restriction parameter using attribute_parameter_values.

Restriction Name

Description

Availability

Any Hazmat Prohibited

The route will exclude roads where transporting any kind of hazardous material is prohibited.

Select countries in North America and Europe

Avoid Carpool Roads

The route will avoid roads designated exclusively for carpool (high-occupancy) vehicles.

All countries

Avoid Express Lanes

The route will avoid roads designated as express lanes.

All countries

Avoid Ferries

The route will avoid ferries.

All countries

Avoid Gates

The route will avoid roads where there are gates, such as keyed-access or guard-controlled entryways.

All countries

Avoid Limited Access Roads

The route will avoid roads designated as limited-access highways.

All countries

Avoid Private Roads

The route will avoid roads that are not publicly owned and maintained.

All countries

Avoid Toll Roads

The route will avoid toll roads.

All countries

Avoid Unpaved Roads

The route will avoid roads that are not paved (for example, dirt, gravel, etc.).

All countries

Avoid Truck Restricted Roads

The route will avoid roads where trucks are not allowed except when making deliveries.

All countries

Axle Count Restriction

The route will not include roads where trucks with the specified number of axles are prohibited. The number of axles can be specified using the Number of Axles restriction parameter.

Select countries in North America and Europe

Driving a Bus

The route will exclude roads where buses are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving a Delivery Vehicle

The route will exclude roads where delivery vehicles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving a Taxi

The route will exclude roads where taxis are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving a Truck

The route will exclude roads where trucks are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving an Automobile

The route will exclude roads where automobiles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Driving an Emergency Vehicle

The route will exclude roads where emergency vehicles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Height Restriction

The route will exclude roads where the vehicle height exceeds the maximum allowed height for the road. The vehicle height can be specified using the Vehicle Height (meters) restriction parameter.

Select countries in North America and Europe

Kingpin to Rear Axle Length Restriction

The route will exclude roads where the vehicle kingpin-to-rear-axle length exceeds the maximum allowed for the road. The vehicle's length between the vehicle kingpin and the rear axle can be specified using the Vehicle Kingpin to Rear Axle Length (meters) restriction parameter.

Select countries in North America and Europe

Length Restriction

The route will exclude roads where the vehicle length exceeds the maximum allowed length for the road. The vehicle length can be specified using the Vehicle Length (meters) restriction parameter.

Select countries in North America and Europe

Preferred for Pedestrians

The route prefers paths designated for pedestrians.

All countries

Riding a Motorcycle

The route will exclude roads where motorcycles are prohibited. Using this restriction also ensures the route will honor one-way streets.

All countries

Roads Under Construction Prohibited

The route will exclude roads that are under construction.

All countries

Semi or Tractor with One or More Trailers Prohibited

The route will exclude roads where semis or tractors with one or more trailers are prohibited.

Select countries in North America and Europe

Single Axle Vehicles Prohibited

The route will exclude roads where vehicles with single axles are prohibited.

Select countries in North America and Europe

Tandem Axle Vehicles Prohibited

The route will exclude roads where vehicles with tandem axles are prohibited.

Select countries in North America and Europe

Through Traffic Prohibited

The route will exclude roads where through traffic (non-local) is prohibited.

All countries

Truck with Trailers Restriction

The route will exclude roads where trucks with the specified number of trailers on the truck are prohibited. The number of trailers on the truck can be specified using the Number of Trailers on Truck restriction parameter.

Select countries in North America and Europe

Use Preferred Hazmat Routes

The route will prefer roads designated for transporting any kind of hazardous materials.

Select countries in North America and Europe

Use Preferred Truck Routes

The route will prefer roads designated as truck routes, such as the roads that are part of the national network as specified by the National Surface Transportation Assistance Act in the United States, or roads that are designated as truck routes by the state or province, or or roads in an area that are generally more suitable for trucks.

Select countries in North America and Europe

Walking

The route will exclude roads where pedestrians are prohibited.

All countries

Weight Restriction

The route will exclude roads where the vehicle weight exceeds the maximum allowed weight for the road. The vehicle weight can be specified using the Vehicle Weight (kilograms) restriction parameter.

Select countries in North America and Europe

Weight per Axle Restriction

The route will exclude roads where the vehicle's weight per axle exceeds the maximum allowed for the road. The vehicle's weight per axle can be specified using the Vehicle Weight per Axle (kilograms) restriction parameter.

Select countries in North America and Europe

Width Restriction

The route will roads where the vehicle width exceeds the maximum allowed for the road. The vehicle width can be specified using the Vehicle Width(meters) restriction parameter.

Select countries in North America and Europe

LegacyLegacy:

Driving a Delivery Vehicle restriction attribute is deprecated and will be unavailable in future releases. To achieve similar results, use Driving a Truck restriction attribute along with Avoid Truck Restricted Roads restriction attribute.

The restrictions parameter value is specified as an array of restriction names. The default value for this parameter is restrictions=[Avoid Carpool Roads, Avoid Express Lanes, Avoid Gates, Avoid Private Roads, Avoid Unpaved Roads, Driving an Truck, Use Preferred Truck Routes, Roads Under Construction Prohibited, Through Traffic Prohibited]. A value of null indicates that no restrictions should be used when finding the best route, but only when travel_mode is set to Custom.

Example: restrictions=[Driving an Emergency Vehicle,Height Restriction,Length Restriction]

attribute_parameter_values

Use this parameter to specify additional values required by an attribute or restriction, such as to specify whether the restriction prohibits, avoids, or prefers travel on restricted roads. If the restriction is meant to avoid or prefer roads, you can further specify the degree to which they are avoided or preferred using this parameter.

CautionCaution:

The value of this parameter, regardless of whether you rely on its default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Custom.

The attributes_parameter_values parameter can be specified using a JSON structure that represents a set of features. The JSON structure can include the following properties:

  • url: Specify a REST query request to any ArcGIS Server feature, map, or geoprocessing service that returns a JSON feature set. This property is optional. However, either features or url must be specified.
  • features: Specify an array of features. This property is optional. However, either the features or url property must be specified.

Each feature in the features array represents an attribute parameter and contains the following properties:

  • attributes: Specify each attribute as a key-value pair where the key is the name of a given field, and the value is the attribute value for the corresponding field.
NoteNote:

The JSON structure for the attribute_parameter_values parameter does not have a geometry property.

Attributes for attribute_parameter_values

The attribute_parameter_values parameter can be specified with the following attributes:

  • AttributeName: Lists the name of the restriction.
  • ParameterName: Lists the name of the parameter associated with the restriction. A restriction can have one or more ParameterName values based on its intended use, which implies you may need multiple attribute_parameter_values parameters for a single attribute name.
  • ParameterValue: The value for the ParameterName that is used by the service when evaluating the restriction.

NoteNote:

In most cases, the attribute_parameter_values parameter is dependent on the restrictions parameter. The ParameterValue specified as part of attribute_parameter_values is applicable only if the restriction name is specified as the value for the restrictions parameter.

When specifying the attribute_parameter_values parameter, each restriction (listed as AttributeName) has a ParameterName value, Restriction Usage, that specifies whether the restriction prohibits, avoids, or prefers travel on the roads associated with the restriction and the degree to which the roads are avoided or preferred.

The Restriction Usage ParameterName can be assigned any of the following string values or their equivalent numeric values listed within the parentheses:

  • PROHIBITED (-1)—Travel on the roads using the restriction is completely prohibited.
  • AVOID_HIGH (5)—It is very unlikely for the service to include, in the results, roads that are associated with the restriction.
  • AVOID_MEDIUM (2)—It is unlikely for the service to include, in the results, roads that are associated with the restriction.
  • AVOID_LOW (1.3)—It is somewhat unlikely for the service to include, in the results, roads that are associated with the restriction.
  • PREFER_LOW (0.8)—It is somewhat likely for the service to include, in the results, results roads that are associated with the restriction.
  • PREFER_MEDIUM(0.5)—It is likely for the service to include, in the results, roads that are associated with the restriction.
  • PREFER_HIGH (0.2)—It is very likely for the service to include, in the results, roads that are associated with the restriction.

In most cases, you can use the default value, PROHIBITED, for Restriction Usage if the restriction is dependent on a physical vehicle characteristic, such as vehicle height. However, in some cases, the value for Restriction Usage depends on your travel preferences. For example, the Avoid Toll Roads restriction has the default value of AVOID_MEDIUM for the Restriction Usage parameter. This means that when the restriction is used, the service will try to route around toll roads when it can. AVOID_MEDIUM also indicates how important it is to avoid toll roads when finding the best route; it has a medium priority. Choosing AVOID_LOW would put lower importance on avoiding tolls; choosing AVOID_HIGH instead would give it a higher importance and thus make it more acceptable for the service to generate longer routes to avoid tolls. Choosing PROHIBITED would entirely disallow travel on toll roads, making it impossible for a route to travel on any portion of a toll road. Keep in mind that avoiding or prohibiting toll roads, and thus avoiding toll payments, is the objective for some; in contrast, others prefer to drive on toll roads because avoiding traffic is more valuable to them than the money spent on tolls. In the latter case, you would choose PREFER_LOW, PREFER_MEDIUM, or PREFER_HIGH as the value for Restriction Usage. The higher the preference, the farther the service will go out of its way to travel on the roads associated with the restriction.

The following table lists the restriction names and the default restriction parameter values for all the restrictions. The default value for the attribute_parameter_values parameter is the JSON structure containing all the rows from the table.

TipTip:

If you want to use the default value for any restriction, AttributeName, ParameterName, and ParameterValue do not have to be specified as part of the attribute_parameter_values parameter.

AttributeName

ParameterName

ParameterValue

Any Hazmat Prohibited

Restriction Usage

PROHIBITED

Avoid Carpool Roads

Restriction Usage

AVOID_HIGH

Avoid Express Lanes

Restriction Usage

AVOID_HIGH

Avoid Ferries

Restriction Usage

AVOID_MEDIUM

Avoid Gates

Restriction Usage

AVOID_MEDIUM

Avoid Limited Access Roads

Restriction Usage

AVOID_MEDIUM

Avoid Private Roads

Restriction Usage

AVOID_MEDIUM

Avoid Toll Roads

Restriction Usage

AVOID_MEDIUM

Avoid Truck Restricted Roads

Restriction Usage

AVOID_HIGH

Axle Count Restriction

Number of Axles

0

Restriction Usage

PROHIBITED

Driving a Bus

Restriction Usage

PROHIBITED

Driving a Delivery Vehicle

Restriction Usage

PROHIBITED

Driving a Taxi

Restriction Usage

PROHIBITED

Driving a Truck

Restriction Usage

PROHIBITED

Driving an Automobile

Restriction Usage

PROHIBITED

Driving an Emergency Vehicle

Restriction Usage

PROHIBITED

Height Restriction

Restriction Usage

PROHIBITED

Vehicle Height (meters)

0

Kingpin to Rear Axle Length Restriction

Restriction Usage

PROHIBITED

Vehicle Kingpin to Rear Axle Length (meters)

0

Length Restriction

Restriction Usage

PROHIBITED

Vehicle Length (meters)

0

Riding a Motorcycle

Restriction Usage

PROHIBITED

Roads Under Construction Prohibited

Restriction Usage

PROHIBITED

Semi or Tractor with One or More Trailers Prohibited

Restriction Usage

PROHIBITED

Single Axle Vehicles Prohibited

Restriction Usage

PROHIBITED

Tandem Axle Vehicles Prohibited

Restriction Usage

PROHIBITED

Through Traffic Prohibited

Restriction Usage

AVOID_HIGH

Truck with Trailers Restriction

Restriction Usage

PROHIBITED

Number of Trailers on Truck

0

Use Preferred Hazmat Routes

Restriction Usage

PREFER_MEDIUM

Use Preferred Truck Routes

Restriction Usage

PREFER_HIGH

Walking

Restriction Usage

PROHIBITED

WalkTime

Walking Speed (km/h)

5

Weight Restriction

Restriction Usage

PROHIBITED

Vehicle Weight (kilograms)

0

Weight per Axle Restriction

Restriction Usage

PROHIBITED

Vehicle Weight per Axle (kilograms)

0

Width Restriction

Restriction Usage

PROHIBITED

Vehicle Width (meters)

0

Syntax for specifying attribute_parameter_values
{
    "features": [
        {
            "attributes": {
                "<field1>": <value11>,
                "<field2>": <value12>,
                "<field3>": <value13>

            }
        },
        {
            "attributes": {
                "<field1>": <value21>,
                "<field2>": <value22>,
                "<field3>": <value13>
            }
        }
    ] 
}
Example: Specifying the vehicle height and weight and a high preference to use designated truck routes

This example shows how to specify the height and weight of the vehicle for use with the height and weight restrictions respectively along with a high preference to include designated truck routes. This results in a route that does not include any roads where the clearance under overpasses or through tunnels is less than the vehicle height. The results will also not include any roads with load limited bridges or local roads that prohibit heavy vehicles if the vehicle weight exceeds the maximum permissible weight. However, the route will include as many roads as possible that are designated as preferred truck routes.

Note that the Restriction Usage ParameterName for the Height Restriction and the Weight Restriction restrictions are not specified since we want to use the default value of PROHIBITED for these restriction parameters.

attribute_parameter_values=
{
    "features": [
        {
            "attributes": {
                "AttributeName": "Height Restriction",
                "ParameterName": "Vehicle Height (meters)",
                "ParameterValue": 4.12
            }
        },
        {
            "attributes": {
                "AttributeName": "Weight Restriction",
                "ParameterName": "Vehicle Weight (kilograms)",
                "ParameterValue": 36287
            }
        },
        {
            "attributes": {
                "AttributeName": "Use Preferred Truck Routes",
                "ParameterName": "Restriction Usage",
                "ParameterValue": "PREFER_HIGH"
            }
        }
    ]
}

route_shape

Use this parameter to specify the type of route features that are output by the service. The parameter can be specified using one of the following values:

  • True Shape (default): Return the exact shape of the resulting route that is based on the underlying streets. Since this option creates the most detailed geometry for the output routes, choosing it tends to make the process run longer and create larger output files.
  • True Shape with Measures: Return the exact shape of the resulting route that is based on the underlying streets. Additionally, construct measures so the shape may be used in linear referencing. The measurements increase from the first stop and record the cumulative travel time or travel distance in the units specified by the measurement_units parameter.
  • Straight Line: Return a straight line between the route start and end.
  • None: Do not return any route shapes. This value can be useful in cases where you want to optimize performance and are only interested in determing the route's total travel time or travel distance, but not the route paths.

When the route_shape parameter is set to True Shape, or True Shape with Measure, the generalization of the route shape can be further controlled using the appropriate value for the route_ line_simplification_tolerance parameter.

No matter which value you choose for the route_shape parameter, the best route is always determined by minimizing the travel time or the travel distance, never using the straight-line distance between stops. This means that only the route shapes are different, not the underlying streets that are searched when finding the route.

TipTip:

Specifying True Shape or True Shape with Measures creates the most detailed geometry for the output routes. So choosing these options tends to increase the response time for the request and also create larger responses. So use these options only when the exact route shape is required.

route_line_simplification_tolerance

Use this parameter to specify by how much you want to simplify the route geometry returned by the service.

NoteNote:
  • The value of this parameter, regardless of whether you rely on the default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Driving, so unless you set travel_mode to a different value, this parameter value will be overridden.

  • This parameter is relevant only when route_shape is set to True Shape because the other outputs cannot be simplified further.

Simplification maintains critical points on a route, such as turns at intersections, to define the essential shape of the route and removes other points. The simplification distance you specify is the maximum allowable offset that the simplified line can deviate from the original line. Simplifying a line reduces the number of vertices that are part of the route geometry. This reduces the overall response size and also improves the performance for drawing the route shapes in applications.

The parameter is specified as a JSON structure that includes the following properties:

  • distance: The simplification distance value.
  • units: The units for the simplification distance value. The property value should be specified as one of the following values: esriCentimeters, esriDecimalDegrees, esriDecimeters, esriFeet, esriInches, esriKilometers, esriMeters, esriMiles, esriMillimeters, esriNauticalMiles, esriPoints, and esriYards.

The default value for the route_line_simplification_tolerance parameter is 10 meters.

Syntax for specifying route_line_simplification_tolerance
{
    "distance": <value>,
    "units": "<unit>"
}
Example: Specifying route_line_simplification_tolerance of 10 meters
{
    "distance": 10,
    "units": "esriMeters"
}

populate_route_edges

Specify whether the tool should generate edges for each route. Route edges represent the individual street features or other similar features, such as trails, that are traversed by a route. The output route edges is commonly used to see which streets are traveled on the most or least by the resultant routes.

  • true—Generate route edges.

  • false—Don't generate route edges. This is the default value.

populate_directions

Use this parameter to specify whether the service should generate driving directions for each route.

  • true—Generate directions. This is the default value. The directions are configued based on the values for the directions_language, directions_style_name, and directions_distance_units parameters.

  • false—Don't generate directions. This is the default value. The service returns an empty value for the features property within the output_directions output parameter.

directions_language

Use this parameter to specify the language that should be used when generating driving directions. This parameter is used only when the populate_directions parameter is set to true. The parameter value can be specified using one of the following values:

  • ar - Generate directions in Arabic
  • cs - Generate directions in Czech
  • de - Generate directions in German
  • el - Generate directions in Greek
  • en (default) - Generate directions in English
  • es - Generate directions in Spanish
  • et - Generate directions in Estonian
  • fr - Generate directions in French
  • he - Generate directions in Hebrew
  • it - Generate directions in Italian
  • ja - Generate directions in Japanese
  • ko - Generate directions in Korean
  • lt - Generate directions in Lithuanian
  • lv - Generate directions in Latvian
  • nl - Generate directions in Dutch
  • pl - Generate directions in Polish
  • pt-BR - Generate directions in Brazilian Portuguese
  • pt-PT - Generate directions in Portuguese (Portugal)
  • ru - Generate directions in Russian
  • sv - Generate directions in Swedish
  • tr - Generate directions in Turkish
  • zh-CN - Simplified Chinese

NoteNote:

If an unsupported language code is specified, the service returns the directions using the default language, English.

directions_distance_units

Specify the units for displaying travel distance in the driving directions. This parameter is used only when the populate_directions parameter is set to true. The parameter can be specified using one of the following values:

  • Miles (default)
  • Kilometers
  • Meters
  • Feet
  • Yards
  • NauticalMiles

directions_style_name

Use this parameter to specify the name of the formatting style for the directions. This parameter is used only when the populate_directions parameter is set to true. The parameter can be specified using the following values:

  • NA Desktop (default)—Generates turn-by-turn directions suitable for printing.
  • NA Navigation—Generates turn-by-turn directions designed for an in-vehicle navigation device.

impedance

Specify the impedance.

CautionCaution:

The value of this parameter, regardless of whether you rely on its default or explicitly set a value, is overridden when travel_mode is set to any other value than Custom. The default value for travel_mode is Custom.

Impedance is a value that quantifies travel along the transportation network. Travel distance is an example of impedance; it quantifies the length of walkways and road segments. Similarly, drive time—the typical time it takes to drive a car along a road segment—is an example of impedance. Drive times may vary by type of vehicle—for instance, the time it takes for a truck to travel along a path tends to be longer than a car—so there can be many impedance values representing travel times for different vehicle types. Impedance values may also vary with time; live and historical traffic reference dynamic impedance values. Each walkway and road segment stores at least one impedance value. When performing a network analysis, the impedance values are used to calculate the best results, such as finding the shortest route—the route that minimizes impedance—between two points.

The impedance parameter can be specified using the following values:

  • Drive Time—Models travel times for a car. These travel times can be dynamic, fluctuating according to traffic flows, in areas where traffic data is available.
  • Truck Time (default)—Models travel times for a truck. These travel times are static for each road and don't fluctuate with traffic.
  • Walk Time—Models travel times for a pedestrian. The default walking speed is 5 kilometers per hour (3.1 miles per hour), but you can change that speed through the attribute_parameter_values parameter by setting Walking Speed (km/h) to a different value.
  • Travel Distance—Stores length measurements along roads and paths. To model walk distance, set impedance to Travel Distance and make sure to pass in the restriction parameter with the Walking restriction, which helps ensure the only paths traveled on allow pedestrian traffic. Similarly, to model car or truck distance, set impedance to Travel Distance and set appropriate values for the restrictions and attribute_parameter_values parameters. This will help ensure your vehicle travels only on roads where it is permitted to do so.

If you pass Drive Time, Truck Time, or Walk Time, the measurement_units parameter must be set to a time-based value; if you set impedance to Travel Distance, measurement_units must be distance-based.

env:outSR

Use this parameter to specify the spatial reference of the geometries, such as the routes or the directions, returned by the service.

The parameter value can be specified as a well-known ID (WKID) for the spatial reference. If env:outSR is not specified, the geometries are returned in the default spatial reference, WGS84. See Geographic coordinate systems and Projected coordinate systems to look up WKID values.

Many of the basemaps provided by ArcGIS Online are in the Web Mercator spatial reference (WKID 102100). Specifying env:outSR=102100 returns the geometries in the Web Mercator spatial reference, which can be drawn on top of the basemaps.

save_route_data

Use this parameter to specify whether the service should create a zip file that contains a file geodatabase holding the inputs and outputs of the analysis in a format that can be used to share route layers with your portal.

  • true—Saves route data. The route data zip file can be downloaded from the URL provided as part of the output_route_data parameter.

  • false—Don't save route data. This is the default value.

save_output_network_analysis_layer

Use this parameter to specify if the service should save the analysis settings as a network analysis layer file. You cannot directly work with this file even when you open the file in an ArcGIS Desktop application like ArcMap. It is meant to be sent to Esri Technical Support in order to diagnose the quality of results returned from the service.

  • true—Saves network analysis layer file. The file can be downloaded from the URL provided as part of the output_network_analysis_layer parameter.

  • false—Don't save network analysis layer file. This is the default value.

overrides

Specify additional settings that can influence the behavior of the solver when finding solutions for the network analysis problems.

The value for this parameter needs to be specified in JavaScript Object Notation (JSON). The values can be either a number, Boolean, or a string.

{
"overrideSetting1" : "value1", 
"overrideSetting2" : "value2"
}

The default value for this parameter is no value, which indicates not to override any solver settings.

Overrides are advanced settings that should be used only after careful analysis of the results obtained before and after applying the settings. A list of supported override settings for each solver and their acceptable values can be obtained by contacting Esri Technical Support.

Usage limits

The table below lists the limits that apply to the asynchronous route operation.

Overrides

Limit Description

Limit Value

Maximum number of stops:

10,000

Maximum number of stops per route:

150

Maximum number of (point) barriers:

250

Maximum number of street features intersected by polyline barriers:

500

Maximum number of street features intersected by polygon barriers:

2,000

Maximum straight-line distance for the walking travel mode:

(If the straight-line distance between any two stops is greater than this limit, the analysis will fail when the walking option for travel_mode is chosen.)

50 miles (80.46 kilometers)

Force hierarchy beyond a straight-line distance of:

(If the straight-line distance between any two stops is greater than the limit shown here, the analysis uses hierarchy, even if useHierarchy is set to false.)

50 miles (80.46 kilometers)

Maximum snap tolerance:

(If the distance between an input point and its nearest traversable street is greater than the distance specified here, the point is excluded from the analysis.)

12.42 miles (20 kilometers)

Maximum time a client can use this route service:

1 hour (3,600 seconds)

Maximum number of directions features that can be returned:

1,000,000

Maximum number of route edges that can be returned:

1,000,000

Example

NoteNote:

If you copy and paste the request URL from the examples into a web browser, you will get an invalid token error message. You need to replace <yourToken> with a valid token. See Accessing services provided by Esri to see how to generate one.

Routing between two points

This example demonstrates routing between two points in Melbourne, Australia.

Request URL to submit the job

The first request is to submit a job which returns the job id.

http://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob?token=<your token>&stops={"features":[{"attributes":{"Name":"Stop1"},"geometry":{"x":145.0657306480001,"y":-37.86513493399997}},{"attributes":{"Name":"Stop2"},"geometry":{"x":145.1049567670001,"y":-37.81866925199995}}]}&f=json

JSON response

{
    "jobId": "jd6f6b61f07654f5aa5ef1b2392384e67",
    "jobStatus": "esriJobSubmitted"
}

Request URL to query job status

The job ID obtained from the response of the first request can be queried periodically to determine the status of the job.

https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/<youJobID>/?token=<yourToken>&returnMessages=true&f=json

JSON response

{
    "jobId": "j40959ba120534c138797d79bc9b40df9",
    "jobStatus": "esriJobSucceeded",
    "results": {
        "Solve_Succeeded": {
            "paramUrl": "results/Solve_Succeeded"
        },
        "Output_Routes": {
            "paramUrl": "results/Output_Routes"
        },
        "Output_Route_Edges": {
            "paramUrl": "results/Output_Route_Edges"
        },
        "Output_Directions": {
            "paramUrl": "results/Output_Directions"
        },
        "Output_Stops": {
            "paramUrl": "results/Output_Stops"
        }
    },
    "inputs": {
        "Stops": {
            "paramUrl": "inputs/Stops"
        },
        "Measurement_Units": {
            "paramUrl": "inputs/Measurement_Units"
        },
        "Analysis_Region": {
            "paramUrl": "inputs/Analysis_Region"
        },
        "Reorder_Stops_to_Find_Optimal_Routes": {
            "paramUrl": "inputs/Reorder_Stops_to_Find_Optimal_Routes"
        },
        "Preserve_Terminal_Stops": {
            "paramUrl": "inputs/Preserve_Terminal_Stops"
        },
        "Return_to_Start": {
            "paramUrl": "inputs/Return_to_Start"
        },
        "Use_Time_Windows": {
            "paramUrl": "inputs/Use_Time_Windows"
        },
        "Time_of_Day": {
            "paramUrl": "inputs/Time_of_Day"
        },
        "Time_Zone_for_Time_of_Day": {
            "paramUrl": "inputs/Time_Zone_for_Time_of_Day"
        },
        "UTurn_at_Junctions": {
            "paramUrl": "inputs/UTurn_at_Junctions"
        },
        "Point_Barriers": {
            "paramUrl": "inputs/Point_Barriers"
        },
        "Line_Barriers": {
            "paramUrl": "inputs/Line_Barriers"
        },
        "Polygon_Barriers": {
            "paramUrl": "inputs/Polygon_Barriers"
        },
        "Use_Hierarchy": {
            "paramUrl": "inputs/Use_Hierarchy"
        },
        "Restrictions": {
            "paramUrl": "inputs/Restrictions"
        },
        "Attribute_Parameter_Values": {
            "paramUrl": "inputs/Attribute_Parameter_Values"
        },
        "Route_Shape": {
            "paramUrl": "inputs/Route_Shape"
        },
        "Route_Line_Simplification_Tolerance": {
            "paramUrl": "inputs/Route_Line_Simplification_Tolerance"
        },
        "Populate_Route_Edges": {
            "paramUrl": "inputs/Populate_Route_Edges"
        },
        "Populate_Directions": {
            "paramUrl": "inputs/Populate_Directions"
        },
        "Directions_Language": {
            "paramUrl": "inputs/Directions_Language"
        },
        "Directions_Distance_Units": {
            "paramUrl": "inputs/Directions_Distance_Units"
        },
        "Directions_Style_Name": {
            "paramUrl": "inputs/Directions_Style_Name"
        }
    },
    "messages": []
}

Request URL to return output stops

Because the job succeeded, a request can be made to return the stops visited by the route. The output parameter used to retrieve these results is output_stops.

https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/<yourJobID>/results/output_stops?token=<yourToken>&returnMessages=true&f=json

JSON response

The stops are essentially duplicates of the input facilities, but they exclude any stops that weren't reached.

{
    "paramName": "Output_Closest_Facilities",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "displayFieldName": "",
        "geometryType": "esriGeometryPoint",
        "spatialReference": {
            "wkid": 4326,
            "latestWkid": 4326
        },
        "fields": [
            {
                "name": "OID",
                "type": "esriFieldTypeOID",
                "alias": "OID"
            },
            {
                "name": "Name",
                "type": "esriFieldTypeString",
                "alias": "Name",
                "length": 50
            },
            {
                "name": "ID",
                "type": "esriFieldTypeString",
                "alias": "ID",
                "length": 50
            },
            {
                "name": "AdditionalTime",
                "type": "esriFieldTypeDouble",
                "alias": "Additional Time"
            },
            {
                "name": "AdditionalDistance",
                "type": "esriFieldTypeDouble",
                "alias": "Additional Distance"
            },
            {
                "name": "CurbApproach",
                "type": "esriFieldTypeSmallInteger",
                "alias": "Curb Approach"
            },
            {
                "name": "ORIG_FID",
                "type": "esriFieldTypeSmallInteger",
                "alias": "ORIG_FID"
            }
        ],
        "features": [
            {
                "attributes": {
                    "OID": 1,
                    "Name": "Station 20",
                    "ID": null,
                    "AdditionalTime": 0,
                    "AdditionalDistance": 0,
                    "CurbApproach": 0,
                    "ORIG_FID": 1
                },
                "geometry": {
                    "x": -122.45596200044594,
                    "y": 37.75131599973366
                }
            },
            {
                "attributes": {
                    "OID": 2,
                    "Name": "Station 39",
                    "ID": null,
                    "AdditionalTime": 0,
                    "AdditionalDistance": 0,
                    "CurbApproach": 0,
                    "ORIG_FID": 3
                },
                "geometry": {
                    "x": -122.45784400000059,
                    "y": 37.74071300000497
                }
            }
        ],
        "exceededTransferLimit": false
    }
}

Request URL to return the output routes

Because the job succeeded, a request can be made to return the routes from the output_routes output parameter.

https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/<yourJobID>/results/output_routes?token=<youToken>&returnMessages=true&f=json

JSON response

NoteNote:

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

{
    "paramName": "Output_Routes",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "displayFieldName": "",
        "geometryType": "esriGeometryPolyline",
        "spatialReference": {
            "wkid": 4326,
            "latestWkid": 4326
        },
        "fields": [
            {
                "name": "OID",
                "type": "esriFieldTypeOID",
                "alias": "OID"
            },
            {
                "name": "Name",
                "type": "esriFieldTypeString",
                "alias": "Name",
                "length": 128
            },
            {
                "name": "StopCount",
                "type": "esriFieldTypeInteger",
                "alias": "StopCount"
            },
            {
                "name": "Total_Minutes",
                "type": "esriFieldTypeDouble",
                "alias": "Total_Minutes"
            },
            {
                "name": "Total_Miles",
                "type": "esriFieldTypeDouble",
                "alias": "Total_Miles"
            },
            {
                "name": "FirstStopOID",
                "type": "esriFieldTypeInteger",
                "alias": "FirstStopOID"
            },
            {
                "name": "LastStopOID",
                "type": "esriFieldTypeInteger",
                "alias": "LastStopOID"
            },
            {
                "name": "Total_Kilometers",
                "type": "esriFieldTypeDouble",
                "alias": "Total_Kilometers"
            },
            {
                "name": "Shape_Length",
                "type": "esriFieldTypeDouble",
                "alias": "Shape_Length"
            }
        ],
        "features": [
            {
                "attributes": {
                    "OID": 1,
                    "Name": "Stop1 - Stop2",
                    "StopCount": 2,
                    "Total_Minutes": 12.560998302743993,
                    "Total_Miles": 5.332129199370574,
                    "FirstStopOID": 1,
                    "LastStopOID": 2,
                    "Total_Kilometers": 8.58123,
                    "Shape_Length": 0.08516636408377337
                },
                "geometry": {
                    "paths": [
                        [
                            [
                                145.06591391900008,
                                -37.86473982999996
                            ],
                            [
                                145.0671000000001,
                                -37.86528999999996
                            ],
							                     
																											 ...
							                     ... additional points
							                     ...
  
                            [
                                145.10584000000006,
                                -37.818539999999985
                            ],
                            [
                                145.10498172400003,
                                -37.81844463599998
                            ]
                        ]
                    ]
                }
            }
        ],
        "exceededTransferLimit": false
    }
}

Request URL to return the output route edges

A request can also be made to return the roads the route traversed by using the output_route_edges output parameter.

https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/<yourJobID>/results/output_route_edges?<yourToken>&returnMessages=true&f=json

JSON response

NoteNote:

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

{
    "paramName": "Output_Route_Edges",
    "dataType": "GPFeatureRecordSetLayer",
    "value": {
        "displayFieldName": "",
        "geometryType": "esriGeometryPolyline",
        "spatialReference": {
            "wkid": 4326,
            "latestWkid": 4326
        },
        "fields": [
            {
                "name": "ObjectID",
                "type": "esriFieldTypeOID",
                "alias": "ObjectID"
            },
            {
                "name": "SourceName",
                "type": "esriFieldTypeString",
                "alias": "SourceName",
                "length": 255
            },
            {
                "name": "SourceOID",
                "type": "esriFieldTypeInteger",
                "alias": "SourceOID"
            },
            {
                "name": "RouteEdgeID",
                "type": "esriFieldTypeInteger",
                "alias": "RouteEdgeID"
            },
            {
                "name": "FromPosition",
                "type": "esriFieldTypeDouble",
                "alias": "FromPosition"
            },
            {
                "name": "ToPosition",
                "type": "esriFieldTypeDouble",
                "alias": "ToPosition"
            },
            {
                "name": "RouteID",
                "type": "esriFieldTypeInteger",
                "alias": "RouteID"
            },
            {
                "name": "Attr_Minutes",
                "type": "esriFieldTypeDouble",
                "alias": "Attr_Minutes"
            },
            {
                "name": "Cumul_Minutes",
                "type": "esriFieldTypeDouble",
                "alias": "Cumul_Minutes"
            },
            {
                "name": "Attr_Miles",
                "type": "esriFieldTypeDouble",
                "alias": "Attr_Miles"
            },
            {
                "name": "Cumul_Miles",
                "type": "esriFieldTypeDouble",
                "alias": "Cumul_Miles"
            },
            {
                "name": "Attr_Kilometers",
                "type": "esriFieldTypeDouble",
                "alias": "Attr_Kilometers"
            },
            {
                "name": "Cumul_Kilometers",
                "type": "esriFieldTypeDouble",
                "alias": "Cumul_Kilometers"
            },
            {
                "name": "Attr_Avoid_Unpaved_Roads",
                "type": "esriFieldTypeInteger",
                "alias": "Attr_Avoid Unpaved Roads"
            },
            {
                "name": "Attr_Avoid_Private_Roads",
                "type": "esriFieldTypeInteger",
                "alias": "Attr_Avoid Private Roads"
            },
            {
                "name": "Attr_Avoid_Gates",
                "type": "esriFieldTypeInteger",
                "alias": "Attr_Avoid Gates"
            },
            {
                "name": "Attr_Through_Traffic_Prohibited",
                "type": "esriFieldTypeInteger",
                "alias": "Attr_Through Traffic Prohibited"
            },
            {
                "name": "Shape_Length",
                "type": "esriFieldTypeDouble",
                "alias": "Shape_Length"
            }
        ],
        "features": [
            {
                "attributes": {
                    "ObjectID": 1,
                    "SourceName": "Routing_Streets",
                    "SourceOID": 348757,
                    "RouteEdgeID": 1044044,
                    "FromPosition": 0.24152278890808054,
                    "ToPosition": 0,
                    "RouteID": 1,
                    "Attr_Minutes": 0.26806711433068997,
                    "Cumul_Minutes": 0.26806711433068997,
                    "Attr_Miles": 0.08134,
                    "Cumul_Miles": 0.08134,
                    "Attr_Kilometers": 0.1309,
                    "Cumul_Kilometers": 0.13091,
                    "Attr_Avoid_Unpaved_Roads": 0,
                    "Attr_Avoid_Private_Roads": 0,
                    "Attr_Avoid_Gates": 0,
                    "Attr_Through_Traffic_Prohibited": 0,
                    "Shape_Length": 0.001307468992936962
                },
                "geometry": {
                    "paths": [
                        [
                            [
                                145.06591391900008,
                                -37.86473982999996
                            ],
                            [
                                145.0671000000001,
                                -37.86528999999996
                            ]
                        ]
                    ]
                }
            },
            {
                "attributes": {
                    "ObjectID": 2,
                    "SourceName": "Routing_Streets",
                    "SourceOID": 348752,
                    "RouteEdgeID": 1044034,
                    "FromPosition": 0.7871324499552366,
                    "ToPosition": 0.6536826964062661,
                    "RouteID": 1,
                    "Attr_Minutes": 0.12864303488287535,
                    "Cumul_Minutes": 0.3967101492135653,
                    "Attr_Miles": 0.04901,
                    "Cumul_Miles": 0.13035,
                    "Attr_Kilometers": 0.07887,
                    "Cumul_Kilometers": 0.20977,
                    "Attr_Avoid_Unpaved_Roads": 0,
                    "Attr_Avoid_Private_Roads": 0,
                    "Attr_Avoid_Gates": 0,
                    "Attr_Through_Traffic_Prohibited": 0,
                    "Shape_Length": 0.0007660939890334768
                },
                "geometry": {
                    "paths": [
                        [
                            [
                                145.0671000000001,
                                -37.86528999999996
                            ],
                            [
                                145.0666500000001,
                                -37.86466999999993
                            ]
                        ]
                    ]
                }
            },

							                     
												...
							     ... additional lines
							     ...
  

            {
                "attributes": {
                    "ObjectID": 94,
                    "SourceName": "Routing_Streets",
                    "SourceOID": 353664,
                    "RouteEdgeID": 1053829,
                    "FromPosition": 1,
                    "ToPosition": 0.5795813481826116,
                    "RouteID": 1,
                    "Attr_Minutes": 0.034457844833688085,
                    "Cumul_Minutes": 12.338099872364964,
                    "Attr_Miles": 0.00627,
                    "Cumul_Miles": 5.28493,
                    "Attr_Kilometers": 0.01009,
                    "Cumul_Kilometers": 8.50527,
                    "Attr_Avoid_Unpaved_Roads": 0,
                    "Attr_Avoid_Private_Roads": 0,
                    "Attr_Avoid_Gates": 0,
                    "Attr_Through_Traffic_Prohibited": 0,
                    "Shape_Length": 0.00009999999999763532
                },
                "geometry": {
                    "paths": [
                        [
                            [
                                145.10592000000008,
                                -37.81859999999995
                            ],
                            [
                                145.10584000000006,
                                -37.818539999999985
                            ]
                        ]
                    ]
                }
            },
            {
                "attributes": {
                    "ObjectID": 95,
                    "SourceName": "Routing_Streets",
                    "SourceOID": 353638,
                    "RouteEdgeID": 1053824,
                    "FromPosition": 1,
                    "ToPosition": 0.8187049287099665,
                    "RouteID": 1,
                    "Attr_Minutes": 0.22289843037902846,
                    "Cumul_Minutes": 12.560998302743993,
                    "Attr_Miles": 0.0472,
                    "Cumul_Miles": 5.33213,
                    "Attr_Kilometers": 0.07596,
                    "Cumul_Kilometers": 8.58123,
                    "Attr_Avoid_Unpaved_Roads": 0,
                    "Attr_Avoid_Private_Roads": 0,
                    "Attr_Avoid_Gates": 0,
                    "Attr_Through_Traffic_Prohibited": 0,
                    "Shape_Length": 0.0008635577483443818
                },
                "geometry": {
                    "paths": [
                        [
                            [
                                145.10584000000006,
                                -37.818539999999985
                            ],
                            [
                                145.10498172400003,
                                -37.81844463599998
                            ]
                        ]
                    ]
                }
            }
        ],
        "exceededTransferLimit": false
    }
}
3/3/2017