/FindRoutes

GETGETPOST
Use dark colors for code blocksCopy
1
GET  https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob

The /FindRoutes job request find the best way to get from one location to another or to visit several locations.

Parameters

NameRequiredTypeDefaultDescription
string

The request response format, either json or pjson

string

An access token with the required privileges.

feature

Two or more locations between which the route is generated.

object

The mode of transportation for the analysis provided as a JSON object.

object

Determines how input data are located.

string

Minutes

Units that should be used to report the total travel time or travel distance for the output routes.

string

Region in which to perform the analysis.

boolean

false

Reorders stops to find an optimized route.

string

Preserve First

Preserve the starting or ending stops and let the service reorder the rest. Ignored when reorder_stops_to_find_optimal_routes is false.

boolean

true

Routes should start and end at the same location.

boolean

false

Consider time windows specified on the stops when finding the best route.

string

Geographically Local

The time zone for the time window values on stops.

datetime

The time and date the routes will begin.

string

Geographically Local

The time zone or zones of the time_of_day parameter.

string

Allowed only at Intersections and Dead Ends

Restricts or allows a route to make U-turns at junctions.

feature

One or more points that act as temporary restrictions, additional time, or distance.

feature

One ore more lines that prohibit travel anywhere the lines intersect the streets.

feature

Polygons that either prohibit travel or proportionately scale the time or distance required to travel on the streets.

boolean

true

Hierarchy used when finding the shortest paths.

[string]

The restrictions that should be honored by the service.

table

Additional values required by an attribute or restriction.

string

Time-based impedance.

string

Miles

Distance-based impedance.

string

Type of impedance.

string

True Shape

The type of route features that are output by the service.

number

10

Simplification level for the route geometry returned by the service.

boolean

false

Generate edges for each route.

boolean

false

Generates the driving directions for each route.

string

en

The language used when generating driving directions.

string

Miles

Units for displaying travel distance in the driving directions.

string

NA Desktop

The formatting style for the directions. Used ifpopulate_directions=true.

boolean

false

Route data will be saved as a .zip file.

boolean

false

Save the analysis settings as a network analysis layer file.

string

Feature Set

Format in which the output features will be returned.

object

Additional settings that affect task operation

string

For internal use only.

boolean

true

Ignores invalid input locations.

Required parameters

f

The response format.

Use dark colors for code blocksCopy
1
f=json

token

An access token with the required privileges.

  • ArcGIS Location Platform: premium:user:networkanalysis:routing or premium:user:networkanalysis:optimizedrouting
  • ArcGIS Online: premium:user:networkanalysis
Use dark colors for code blocksCopy
1
token=<ACCESS_TOKEN>

Learn more about access tokens and privileges in the Security and authentication developer guide.

stops

The locations the output route or routes will visit.

When specifying the stops, you can set attributes for each as follows:

Show attributes for stops

Attributes for stops

  • Namestring (length: 500)nullable

    The name of the stop. The name is used in the driving directions. If the name is not specified, a unique name prefixed with Location is automatically generated in the output stops, routes, and directions.

  • IDinteger (non-negative)nullable

    A unique identifier for the stop. The identifier is included in the output routes (as the StopID field) and can help join additional information from the output routes, such as the total travel time or total distance, to attributes from your incidents or vice versa. If the ID isn't specified, the service automatically generates a unique identifier for each stop.

  • RouteNamestring (length: 1024)nullable

    The name of the route to which the stop is assigned. Assigning the same route name to different stops causes those stops to be grouped together and visited by the same route. You can generate many routes in a single solve by assigning unique route names to different groups of stops.

    For example, to find two distinct routes—a route with four stops and another with six stops—set RouteName to Route1 for each of the four stops and Route2 for each of the six 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, 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.

  • Sequenceintegernullable

    If the reorder_stops_to_find_optimal_routes parameter is set to false, the output routes will visit the stops in the order you specify with this attribute. In 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.

  • AdditionalTimenumber (non-negative)default:0

    The amount of time spent at the stop, which is added to the total time of the route.

    The units for this attribute value are specified by the measurement_units parameter. The attribute value is included in the analysis only when the measurement units are time based.

    You can account for the extra time it takes at the stop to complete a task, such as to repair an appliance, deliver a package, or inspect the premises.

  • AdditionalDistancenumber (non-negative)default:0

    The extra distance traveled at the stops, which is added to the total distance of the route.

    The units for this attribute value are specified by the measurement_units parameter. The attribute value is included in the analysis only when the measurement units are distance based.

    Generally, the location of a stop, such as a home, isn't exactly on the street; it is set back somewhat from the road. This attribute value can be used to model the distance between the actual stop location and its location on the street if it is important to include that distance in the total travel distance.

  • AdditionalCostnumber (non-negative)default:0

    The extra cost spent at the stop, which is added to the total cost of the route.

    This attribute value should be used when the travel mode for the analysis uses an impedance attribute that is neither time based nor distance based. The units for the attribute values are interpreted to be in unknown units.

  • TimeWindowStartdatetimenullable

    The earliest time the stop can be visited. By specifying a start and end time for a stop's time window, you are defining when a route should visit the stop. When the impedance attribute of this analysis, either specified by impedance parameter or the impedance of the travel mode, is time based, by specifying time-window values the analysis will find a solution that minimizes overall travel and reaches the stop within the prescribed time window.

    The value is specified as an integer that represents the number of milliseconds since epoch (January 1, 1970).

    This value can be specified either in UTC or local time, depending on the value given for the use_time_windows parameter.

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

  • TimeWindowEnddatetimenullable

    The latest time the stop can be visited. By specifying a start and end time for a stop's time window, you are defining when a route will visit the stop. When the impedance attribute of this analysis, either specified by impedance parameter or the impedance of the travel mode, is time based, specifying time-window values will cause the analysis to find a solution that minimizes overall travel and reaches the stop within the prescribed time window.

    Together, the TimeWindowStart and TimeWindowEnd attributes make up the time window within which a route can visit the stop. As with TimeWindowStart, the TimeWindowEnd value is specified as an integer that represents the number of milliseconds since epoch (January 1, 1970) and is interpreted as UTC or local time, depending on the value specified for the use_time_windows parameter.

    The time window specified using the 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.

  • CurbApproachint enumdefault:0

    Allowed values: 0, 1, 2, 3

    Specify the direction a vehicle can arrive at and depart from the stop. The options are as following:

    • 0: Either side of vehicle. The vehicle can approach and depart the stop in either direction. U-turns are allowed. You should choose this setting if your vehicle can make a U-turn at the order or if it can pull into a driveway or parking lot and turn around.
    • 1: Right side of vehicle. When the vehicle approaches and departs the stop, the curb must be on the right side of the vehicle. A U-turn is prohibited.
    • 2: Left side of vehicle. When the vehicle approaches and departs the stop, the curb must be on the left side of the vehicle. A U-turn is prohibited.
    • 3: No U-turn. When the vehicle approaches the stop, the curb can be on either side of the vehicle; however, the vehicle must depart without turning around. Learn more about U-turn policies
    Show illustration
    SettingCoded valueDescription

    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 a 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 such as buses that must arrive with the bus stop on the right side.

    Right side of vehicle

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

    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 such as buses that must arrive with the bus stop on the left side.

    Left side of vehicle

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

    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. A U-turn is prohibited.

    No U-turns

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

    The CurbApproach attribute is designed to work with both types of national driving standards: right-hand traffic (United States) and left-hand traffic (United Kingdom). First, consider an incident 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 an incident from one of two directions, that is, so it ends up on the right or left side of the vehicle. For example, if you want to arrive at an incident and not have a lane of traffic between the vehicle and the incident, choose 1 (Right side of vehicle) in the United States and 2 (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.

  • Bearingnumber (non-negative)nullable

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north.

    This attribute is used in conjunction with the BearingTol attribute. Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle. Using this attribute tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the solver determine the side of the street that the point is on.

    Learn more about bearing and bearing tolerance

  • BearingTolnumber (range: 0 - 180)default:30nullable

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing attribute.

    If the Bearing attribute value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated. The units are in degrees. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatencynumber (non-negative)nullable

    Indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    This attribute is only used in the solve process if the Bearing and BearingTol fields also have values; however, providing a NavLatency attribute value is optional, even when values are present in the Bearing and BearingTol.

Example

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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  "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"
Expand

Optional parameters

travel_modes

Choose the mode of transportation for the analysis.

Travel modes are managed and configured in ArcGIS Online by the administrator of your organization to better reflect the organization's workflows.

In the example below, the following is a string representing the Walking Time travel mode as returned by the GetTravelModes tool:

Use dark colors for code blocksCopy
1
"{\"attributeParameterValues\": [{\"attributeName\": \"Avoid Private Roads\", \"parameterName\": \"Restriction Usage\", \"value\": \"AVOID_MEDIUM\"}, {\"attributeName\": \"Walking\", \"parameterName\": \"Restriction Usage\", \"value\": \"PROHIBITED\"}, {\"attributeName\": \"Preferred for Pedestrians\", \"parameterName\": \"Restriction Usage\", \"value\": \"PREFER_LOW\"}, {\"attributeName\": \"WalkTime\", \"parameterName\": \"Walking Speed (km/h)\", \"value\": 5}, {\"attributeName\": \"Avoid Roads Unsuitable for Pedestrians\", \"parameterName\": \"Restriction Usage\", \"value\": \"AVOID_HIGH\"}], \"description\": \"Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel time. The walking speed is set to 5 kilometers per hour.\", \"distanceAttributeName\": \"Kilometers\", \"id\": \"caFAgoThrvUpkFBW\", \"impedanceAttributeName\": \"WalkTime\", \"name\": \"Walking Time\", \"restrictionAttributeNames\": [\"Avoid Private Roads\", \"Avoid Roads Unsuitable for Pedestrians\", \"Preferred for Pedestrians\", \"Walking\"], \"simplificationTolerance\": 2, \"simplificationToleranceUnits\": \"esriMeters\", \"timeAttributeName\": \"WalkTime\", \"type\": \"WALK\", \"useHierarchy\": false, \"uturnAtJunctions\": \"esriNFSBAllowBacktrack\"}"

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "attributeParameterValues": [
    {
      "attributeName": "Avoid Private Roads",
      "parameterName": "Restriction Usage",
      "value": "AVOID_MEDIUM"
    },
    {
      "attributeName": "Walking",
      "parameterName": "Restriction Usage",
      "value": "PROHIBITED"
    },
    {
      "attributeName": "Preferred for Pedestrians",
      "parameterName": "Restriction Usage",
      "value": "PREFER_LOW"
    },
    {
      "attributeName": "WalkTime",
      "parameterName": "Walking Speed (km/h)",
Expand

locate_Settings

Specify settings that affect how inputs are located, such as the maximum search distance to use when locating the inputs on the network or the network sources being used for locating.

The default value is as follows:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "default": {
    "tolerance": 20000,
    "toleranceUnits": "esriMeters",
    "allowAutoRelocate": true,
    "sources": [
      {
        "name": "main.Routing_Streets"
      }
    ]
  }
}

You can specify locate settings and can override locate settings for individual features such as, stops, point_barriers, line_barriers, and polygon_barriers through locator JSON object.

Show examples

Example for locate_settings

Example 1: Specify locate settings using a JSON structure

This example shows how to specify locate settings so inputs are only located within 500 meters of the specified location. A small search tolerance like this can be helpful if you are solving using a walking travel mode and don't want inputs to be located farther than 500 meters from the original point location.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "default": {
    "tolerance": 500,
    "toleranceUnits": "esriMeters",
    "allowAutoRelocate": true,
    "sources": [
      {
        "name": "Routing_Streets"
      }
    ]
  }
}

measurement_units

Allowed values: Meters, Kilometers, Feet, Yards, NauticalMiles, Seconds, Minutes, Hours, Days

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.

analysis_region

Allowed values: Europe, Japan, Korea, MiddleEast MiddleEastAndAfrica, NorthAmerica, SouthAmerica, SouthAsia, Thailand

Specify the region in which to perform the analysis. If a value is not specified for this parameter, the service 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 analysis.

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

reorder_stops_to_find_optimal_routes

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.
  • 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.

preserve_terminal_stops

Allowed values: Preserve First, Preserve Last, Preserve First and Last, Preserve None

When reorder_stops_to_find_optimal_routes is true, you have options to preserve the starting or ending stops and let the service 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 in which 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.
  • 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 service 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

Specify 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. When reorder_stops_to_find_optimal_routes and return_to_start parameters are both set to true, preserve_terminal_stops parameter must be set to Preserve First (which is the default value).
  • false—The route won't start and end at the first stop feature.

use_time_windows

Specify whether the service will consider time windows specified on the stops when finding the best route. The time windows are specified on stops using the TimeWindowStart and TimeWindowEnd attributes.

time_zone_for_time_windows

Allowed values: Geographically Local, UTC

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:00 a.m. and 10:00 a.m., the time window values will be treated as 8:00 a.m. and 10:00 a.m. in eastern standard time.
  • UTC —The time window values associated with the stops are in UTC. For example, if the stop is located in an area that follows eastern standard time and has time window values of 8:00 a.m. and 10:00 a.m., the time window values will be treated as 3:00 a.m. and 5:00 a.m. eastern standard time. Specifying the time window values in UTC is useful if you don't know the time zones of the stops but know the absolute time for the time windows (for example, the time window starts an hour from now). 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, all time window values are always treated as geographically local.

time_of_day

Specify the time and date the routes will begin.

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

To use traffic in the analysis, choose a time-based unit for impedance and assign a value to time_Of_day.

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.

If the time_Of_day specified is within 4 hours of the current time, live traffic will be used where available. Live traffic retrieves speeds based on phone probe records, sensors, and other data sources and reflects the current travel speeds and predicts speeds for the near future. If the time_Of_day specified is earlier than 4 hours or later than 4 hours from the current time, or the road does not have live traffic, typical traffic speeds will be used. Typical speeds are based on historical traffic patterns. The travel time data is aggregated in 15 minute intervals per day of week based on multiple years worth of data. So a road may have a different travel time at Monday at 8 am, Monday at 8:15 am, or Tuesday at 8 am. Since the variance is just at the day of week and time of day, the travel time is the same on a road for any Monday at 8 am, regardless of the month or year.

If your goal is to model typical travel conditions and avoid large variances from the average due to live traffic, it is recommended to use a date from the past to ensure it doesn't coincide with the 4 hour window from the current time. As an extreme example, you can even use dates from 1990.

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

The service support two kinds of traffic: live and typical.

Typical traffic

To ensure the task 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., January 4, 1990; and convert to milliseconds (631458180000). Although the dates representing days of the week are from 1990, typical traffic is calculated from recent traffic trends—usually over the last two years worth of data.

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 4 hours and references predictive data extending 4 hours into the future. If the time and date you specify for this parameter is outside the 8-hour time window, or the travel time in the analysis continues past the predictive data window, the task falls back to typical traffic speeds.

Show examples

Typical traffic on Thursdays

13:03, January 4, 1990. Typical traffic on Thursdays at 1:03 p.m.

Use dark colors for code blocksCopy
1
2
3
{
  "time_Of_day": 631458180000
}

time_zone_for_time_of_day

Allowed values: Geographically Local, UTC

Specify the time zone or zones of the time_Of_day parameter.

  • Geographically Local—The time_Of_day value refers to the time zone or zones in which the input points are located. This option causes the analysis to have rolling start times across time zones.

    Illustration of setting the value to Geographically Local

    Setting time_of_day to 9:00 a.m., January 4, 1990 (631443600000 milliseconds); time_zone_for_time_Of_Day to Geographically Local; and submitting a valid request causes the drive times for points in the eastern time zone to start at 9:00 a.m. eastern Time and 9:00 a.m. central time for points in the central time zone. (The start times are offset by an hour in real or UTC time.)

    Time zone for time of day parameter is set to geographically local
    Input: time_Of_day is 9:00 a.m., January 4, 1990 (631443600000 milliseconds), and time_zone_for_time_Of_day is set to Geographically Local
  • UTC—The time_Of_day value refers to coordinated universal time (UTC). The start times for all points are simultaneous, regardless of time zones.

    Illustration of setting the value to UTC

    Setting time_Of_day to 9:00 a.m., January 4, 1990 (631443600000 milliseconds); time_zone_for_time_Of_Day to UTC, the start times for points in the eastern time zone is 4:00 a.m. Eastern Time and 3:00 a.m. central time for those in the central time zone.

    Time zone for time of day parameter is set to UTC
    Input: time_Of_day is 9:00 a.m., January 4, 1990 (631443600000 milliseconds), and time_zone_for_time_Of_day is set to UTC

uturn_at_junctions

Allowed values: Allowed, Allowed only at Intersections and Dead Ends, Allowed only at Dead Ends, Not Allowed

Specify whether to restrict or permit the route from making U-turns at junctions.

To understand the available parameter values, 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.

Expand to learn more about the available parameter values

This parameter can have the following values:

Parameter ValueDescription

Allowed

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

U-turns permitted

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 permitted 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 intersections and are permitted only at dead ends.

U-turns permitted 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. Even when this parameter value is chosen, a route can still make U-turns at stops. To prohibit U-turns at a stop, you can set its CurbApproach property to the appropriate value (3).

point_barriers

Specify one or more points that will 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 a time delay spent at a railroad crossing.

When specifying point barriers, you can set properties for each, such as its name or barrier type.

Show attributes for point_barriers

Attributes for point_barriers

  • Namestringnullable

    The name of the barrier.

  • CurbApproachint enumdefault:0

    Allowed values: 0, 1, 2

    Specify the direction of traffic that is affected by the barrier. The field value is specified as one of the following integers:

    • 0: Either side of vehicle. The barrier affects travel over the edge in both directions.
    • 1: Right side of vehicle. Vehicles are only affected if the barrier is on their right side during the approach. Vehicles that traverse the same edge but approach the barrier on their left side are not affected by the barrier.
    • 2: Vehicles are only affected if the barrier is on their left side during the approach. Vehicles that traverse the same edge but approach the barrier on their right side are not affected by the barrier.

    Because junctions are points and don't have a side, barriers on junctions affect all vehicles regardless of the curb approach.

  • BarrierTypeint enumdefault:0

    Allowed values: 0, 2

    Specify 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: Restriction. Prohibits travel through the barrier. The barrier is referred to as a restriction point barrier since it acts as a restriction.

      Two maps demonstrate how a restriction point barrier affects a route analysis.

      The first map shows the shortest path between two stops without any restriction point barriers. The second map has a road that is blocked by a fallen tree, so the shortest path between the same points is longer.

    • 2: Added Cost. Traveling through the barrier increases the travel time or distance by the amount specified in the Additional_Time, Additional_Distance, or AdditionalCost attribute. This barrier type is referred to as an added cost point barrier.
    Two maps demonstrate how added cost point barriers affect a route analysis.

    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.

  • FullEdgeint enumdefault:0

    Allowed values: 0, 1

    Specify how the restriction point barriers are applied to the edge elements during the analysis

    • 0:False—Permits travel on the edge up to the barrier but not through it.
    • 1:True—Restricts travel anywhere on the associated edge.
  • Additional_Timenumber (non-negative)default:0

    The added travel time when the barrier is traversed. This attribute is applicable only for added-cost barriers. The attribute value must be greater than or equal to zero, and its units are the same as those specified in the measurement_units parameter.

  • Additional_Distancenumber (non-negative)default:0

    The added distance when the barrier is traversed. This attribute is applicable only for added-cost barriers. The attribute value must be greater than or equal to zero, and its units are the same as those specified in the measurement_units parameter.

  • AdditionalCostnumber (non-negative)default:0

    The added cost when the barrier is traversed. This attribute is applicable only for added-cost barriers. The attribute value must be greater than or equal to zero.

  • Bearingnumber (non-negative)nullable

    The direction in which a point is moving. The units are degrees and are measured clockwise from true north.

    This attribute is used in conjunction with the BearingTol attribute. Bearing data is usually sent automatically from a mobile device equipped with a GPS receiver. Try to include bearing data if you are loading an input location that is moving, such as a pedestrian or a vehicle. Using this attribute tends to prevent adding locations to the wrong edges, which can occur when a vehicle is near an intersection or an overpass, for example. Bearing also helps the solver determine the side of the street that the point is on.

    Learn more about bearing and bearing tolerance

  • BearingTolnumber (range: 0 - 180)default:30nullable

    The bearing tolerance value creates a range of acceptable bearing values when locating moving points on an edge using the Bearing attribute.

    If the Bearing attribute value is within the range of acceptable values that are generated from the bearing tolerance on an edge, the point can be added as a network location there; otherwise, the closest point on the next-nearest edge is evaluated. The units are in degrees. A value of 30 means that when Network Analyst attempts to add a network location on an edge, a range of acceptable bearing values is generated 15 degrees to either side of the edge (left and right) and in both digitized directions of the edge.

    Learn more about bearing and bearing tolerance

  • NavLatencynumber (non-negative)nullable

    Indicates how much cost is expected to elapse from the moment GPS information is sent from a moving vehicle to a server and the moment the processed route is received by the vehicle's navigation device.

    This attribute is only used in the solve process if the Bearing and BearingTol fields also have values; however, providing a NavLatency attribute value is optional, even when values are present in the Bearing and BearingTol.

Show example

This example shows how to use an added cost point barrier to model a five-minute delay at a railroad crossing. The BarrierType attribute is used to specify that the point barrier is of type added cost and the Attr_TravelTime attribute is used to specify the delay in minutes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "spatialReference": {
    "wkid": 4326
  },
  "features": [
    {
      "geometry": {
        "x": 37.541479,
        "y": -122.053461
      },
      "attributes": {
        "Name": "Haley St railroad crossing",
        "BarrierType": 2,
        "Additional_Time": 5
      }
    }
  ]
}

line_barriers

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 first map displays the shortest path between two stops. The second map shows the shortest path when several streets are blocked by a polyline barrier.

When specifying line barriers, you can set the name of each barrier using the following attribute:

Show attributes for line_barriers

Attributes for line_barriers

  • Namestring (length: 500)nullable

    The name of the barrier.

Show example

This example shows how to add two lines as polyline barriers to restrict travel on the streets intersected by the lines. Barrier 1 is a single-part line feature composed of two points. Barrier 2 is a two-part line feature. The first part is composed of three points, and the second part is composed of two points.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  "spatialReference": {
    "wkid": 102100
  },
  "features": [
    {
      "geometry": {
        "paths": [
          [
            [-10804823.397, 3873688.372],
            [-10804811.152, 3873025.945]
          ]
        ]
      },
      "attributes": {
        "Name": "Barrier 1"
      }
    },
    {
      "geometry": {
Expand

polygon_barriers

Specify polygons that either completely restrict travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

When specifying polygon barriers, you can set properties for each, such as its name or barrier type, using the following attributes:

Show attributes for polygon_barriers

Attributes for polygon_barriers

  • Namestringnullable

    The name of the barrier.

  • BarrierTypeint enumdefault:0

    Allowed values: 0, 1

    Specify polygons that either completely restrict travel or proportionately scale the time or distance required to travel on the streets intersected by the polygons.

    The value for this attribute can be specified as one of the following integers:

    • 0: Restriction. Prohibits traveling through any part of the barrier. The barrier is referred to as a restriction polygon barrier since it prohibits traveling on streets intersected by the barrier. One use of this type of barrier is to model floods covering areas of the street that make traveling on those streets impossible.

      Two maps demonstrate how a restriction polygon barrier affects finding a route between two stops.

      The first map depicts the shortest path between two stops. The second map shows a polygon barrier blocking flooded streets, so the shortest path between the same two stops is different.

    • 1: Scaled Cost. Scales the cost (such as travel time or distance) required to travel the underlying streets by a factor specified using the ScaledTimeFactor or ScaledDistanceFactor attribute.

      If the streets are partially covered by the barrier, the travel time or distance is apportioned and then scaled. For example, a factor of 0.25 means that travel on underlying streets is expected to be four times faster than normal. A factor of 3.0 means it is expected to take three times longer than normal to travel on underlying streets. This barrier type is referred to as a scaled-cost polygon barrier. It can be used to model storms that reduce travel speeds in specific regions, for example.

    Two maps demonstrate how a scaled cost polygon barrier affects finding a route between two stops.

    The first map shows a route that goes through inclement weather without regard for the effect that poor road conditions have on travel time. The second map shows a scaled polygon barrier that doubles the travel time of the roads covered by the storm. 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, and the modified travel time is reported as the total travel time in the response.

  • ScaledTimeFactornumber (non-negative)default:1

    This is the factor by which the travel time of the streets intersected by the barrier is multiplied. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers and when the measurement_units parameter is time-based.

  • ScaledDistanceFactornumber (non-negative)default:1

    This is the factor by which the distance of the streets intersected by the barrier is multiplied. The field value must be greater than zero.

    This field is applicable only for scaled-cost barriers and when the measurement_units parameter is distance-based.

  • ScaledCostFactornumber (non-negative)default:1

    The scaled cost when the barrier is traversed. This attribute is applicable only for scaled-cost barriers. The attribute value must be greater than or equal to zero.

    This field is applicable only for scaled-cost barriers when the impedance is neither time-based nor distance-based.

Show example

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  "spatialReference": {
    "wkid": 4326
  },
  "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
Expand

use_hierarchy

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

  • true—Use hierarchy when travelling between stops. When hierarchy is used, the service 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 service can determine the best route from a relatively smaller subset of streets.
  • false—Do not use hierarchy when travelling between stops. When hierarchy is not used, the service 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.

restrictions

Specify whether the restrictions will 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 the Avoid Toll Roads restriction will result in a route that will include toll roads only when it is required to travel on toll roads to visit a stop. Use Height Restriction to route around clearances that are lower than the height of the vehicle. If the vehicle is carrying corrosive materials, you can use the Any Hazmat Prohibited restriction to prevent hauling the materials along roads where it is marked as illegal to do so.

The parameter value is specified as a comma-separated list of restriction names. A value of null indicates that no restrictions will be used when finding the best route, but only when travel_mode is set to Custom.

Example for restrictions

Use dark colors for code blocksCopy
1
restrictions=[Driving a Truck, Height Restriction, Length Restriction]
Expand to see the restriction names supported by the service
Restriction nameDescription

Any Hazmat Prohibited

The results will not include roads where transporting any kind of hazardous material is prohibited.

Avoid Carpool Roads

The results will avoid roads that are designated exclusively for car pool (high-occupancy) vehicles.

Avoid Express Lanes

The results will avoid roads designated as express lanes.

Avoid Ferries

The results will avoid ferries.

Avoid Gates

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

Avoid Limited Access Roads

The results will avoid roads that are limited-access highways.

Avoid Private Roads

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

Avoid Roads Unsuitable for Pedestrians

The results will avoid roads that are unsuitable for pedestrians.

Avoid Stairways

The results will avoid all stairways on a pedestrian-suitable route.

Avoid Toll Roads

The results will avoid all toll roads for automobiles.

Avoid Toll Roads for Trucks

The results will avoid all toll roads for trucks.

Avoid Truck Restricted Roads

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

Avoid Unpaved Roads

The results will avoid roads that are not paved (for example, dirt, gravel, and so on).

Axle Count Restriction

The results 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.

Driving a Bus

The results will not include roads where buses are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving a Taxi

The results will not include roads where taxis are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving a Truck

The results will not include roads where trucks are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving an Automobile

The results will not include roads where automobiles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Driving an Emergency Vehicle

The results will not include roads where emergency vehicles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Height Restriction

The results will not include 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.

Kingpin to Rear Axle Length Restriction

The results will not include roads where the vehicle length exceeds the maximum allowed kingpin to rear axle for all trucks on the road. The length between the vehicle kingpin and the rear axle can be specified using the Vehicle Kingpin to Rear Axle Length (meters) restriction parameter.

Length Restriction

The results will not include 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.

Preferred for Pedestrians

The results will use preferred routes suitable for pedestrian navigation.

Riding a Motorcycle

The results will not include roads where motorcycles are prohibited. Using this restriction will also ensure that the results will honor one-way streets.

Roads Under Construction Prohibited

The results will not include roads that are under construction.

Semi or Tractor with One or More Trailers Prohibited

The results will not include roads where semis or tractors with one or more trailers are prohibited.

Single Axle Vehicles Prohibited

The results will not include roads where vehicles with single axles are prohibited.

Tandem Axle Vehicles Prohibited

The results will not include roads where vehicles with tandem axles are prohibited.

Through Traffic Prohibited

The results will not include roads where through traffic (nonlocal traffic) is prohibited.

Truck with Trailers Restriction

The results will not include 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.

Use Preferred Hazmat Routes

The results will prefer roads that are designated for transporting hazardous materials.

Use Preferred Truck Routes

The results will prefer roads that are designated as truck routes, such as 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 roads that are preferred by truckers when driving in an area.

Walking

The results will not include roads where pedestrians are prohibited.

Weight Restriction

The results will not include 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.

Weight per Axle Restriction

The results will not include roads where the vehicle weight per axle exceeds the maximum allowed weight per axle for the road. The vehicle weight per axle can be specified using the Vehicle Weight per Axle (kilograms) restriction parameter.

Width Restriction

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

attribute_parameter_values

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. For example, you can choose to never use toll roads, avoid them as much as possible, or prefer them.

Expand to see the default Restriction Usage values for the restrictions
Restriction nameRestriction parameter nameRestriction parameter default value

Any Hazmat Prohibited

Restriction Usage

PROHIBITED

Avoid Carpool Roads

Restriction Usage

PROHIBITED

Avoid Express Lanes

Restriction Usage

PROHIBITED

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 Roads Unsuitable for Pedestrians

Restriction Usage

AVOID_HIGH

Avoid Stairways

Restriction Usage

AVOID_HIGH

Avoid Toll Roads

Restriction Usage

AVOID_MEDIUM

Avoid Toll Roads for Trucks

Restriction Usage

AVOID_MEDIUM

Avoid Truck Restricted Roads

Restriction Usage

AVOID_HIGH

Avoid Unpaved Roads

Restriction Usage

AVOID_HIGH

Axle Count Restriction

Number of Axles

0

Axle Count Restriction

Restriction Usage

PROHIBITED

Driving a Bus

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

Height Restriction

Vehicle Height (meters)

0

Kingpin to Rear Axle Length Restriction

Restriction Usage

PROHIBITED

Kingpin to Rear Axle Length Restriction

Vehicle Kingpin to Rear Axle Length (meters)

0

Length Restriction

Restriction Usage

PROHIBITED

Length Restriction

Vehicle Length (meters)

0

Preferred for Pedestrians

Restriction Usage

PREFER_LOW

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

Truck with Trailers Restriction

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

Weight Restriction

Vehicle Weight (kilograms)

0

Weight per Axle Restriction

Restriction Usage

PROHIBITED

Weight per Axle Restriction

Vehicle Weight per Axle (kilograms)

0

Width Restriction

Restriction Usage

PROHIBITED

Width Restriction

Vehicle Width (meters)

0

Syntax and code sample for attribute parameter values

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "features": [
    {
      "attributes": {
        "<field1>": "<value11>",
        "<field2>": "<value12>",
        "<field3>": "<value13>"
      }
    },
    {
      "attributes": {
        "<field1>": "<value21>",
        "<field2>": "<value22>",
        "<field3>": "<value13>"
      }
    }
  ]
}

time_impedance

Allowed values: Minutes, TravelTime, WalkTime, TruckMinutes, TruckTravelTime

Specify time-based impedance.

distance_impedance

Allowed values: Miles, Kilometers

Specify distance-based impedance.

The value represents the travel distance along road segments or on other parts of the transportation network.

  • Miles—Length measurements along roads are stored in miles and can be used for performing analysis based on shortest distance.
  • Kilometers —Length measurements along roads are stored in kilometers and can be used for performing analysis based on shortest distance.

impedance

Allowed values: TravelTime, Minutes, TruckTravelTime, TruckMinutes, WalkTime, Miles, Kilometers

Specify the impedance.

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 typical 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 parameter can be specified using the following values:

  • TravelTime—Historical and live traffic data is used. This option is good for modeling the time it takes automobiles to travel along roads at a specific time of day using live traffic speed data where available. When using TravelTime, you can optionally set the TravelTime::Vehicle Maximum Speed (km/h) attribute parameter to specify the physical limitation of the speed the vehicle is capable of traveling.
  • Minutes—Live traffic data is not used, but historical average speeds for automobiles data is used.
  • TruckTravelTime—Historical and live traffic data is used, but the speed is capped at the posted truck speed limit. This is good for modeling the time it takes for the trucks to travel along roads at a specific time. When using TruckTravelTime, you can optionally set the TruckTravelTime::Vehicle Maximum Speed (km/h) attribute parameter to specify the physical limitation of the speed the truck is capable of traveling.
  • TruckMinutes—Live traffic data is not used, but the smaller of the historical average speeds for automobiles and the posted speed limits for trucks are used.
  • WalkTime—The default is a speed of 5 km/hr on all roads and paths, but this can be configured through the WalkTime::Walking Speed (km/h) attribute parameter.
  • Miles—Length measurements along roads are stored in miles and can be used for performing analysis based on shortest distance.
  • Kilometers—Length measurements along roads are stored in kilometers and can be used for performing analysis based on shortest distance.

If you choose a time-based impedance, such as TravelTime, TruckTravelTime, Minutes, TruckMinutes, or WalkTime, the measurement_units parameter must be set to a time-based value; if you choose a distance-based impedance such as Miles, Kilometers, the measurement_units must be distance-based.

route_shape

Allowed values: True Shape, True Shape with Measures, Straight Line, None

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—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 determining 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.

route_line_simplification_tolerance

Specify the simplification level for the route geometry returned by the service.

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.

This parameter is relevant only when route_shape is set to True Shape or True Shape with Measures because the other route_shape options cannot be simplified further.

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 .

Syntax and code sample for route line simplification tolerance

Use dark colors for code blocksCopy
1
2
3
4
{
  "distance": "<value>",
  "units": "<unit>"
}

populate_route_edges

Specify whether the service 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—The service will generate route edges.
  • false—Route edges will not be generated by the service.

populate_directions

Specify whether the service will generate driving directions for each route.

directions_language

Specify the language that will be used when generating travel directions.

This parameter applies only when the populate_directions parameter is set to true.

Show all supported languages

The service supports generating directions in the following languages:

  • ar: Arabic
  • bg: Bulgarian
  • bs: Bosnian
  • ca: Catalan
  • cs: Czech
  • da: Danish
  • de: German
  • el: Greek
  • en: English
  • es: Spanish
  • et: Estonian
  • fi: Finnish
  • fr: French
  • he: Hebrew
  • hr: Croatian
  • hu: Hungarian
  • id: Indonesian
  • it: Italian
  • ja: Japanese
  • ko: Korean
  • lt: Lithuanian
  • lv: Latvian
  • nb: Norwegian
  • nl: Dutch
  • pl: Polish
  • pt-BR: Portuguese (Brazil)
  • pt-PT: Portuguese (Portugal)
  • ro: Romanian
  • ru: Russian
  • sk: Slovak
  • sl: Slovenian
  • sr: Serbian
  • sv: Swedish
  • th: Thai
  • tr: Turkish
  • uk: Ukrainian
  • vi: Vietnamese
  • zh-CN: Chinese (China)
  • zh-HK: Chinese (Hong Kong)
  • zh-TW: Chinese (Taiwan)

The service searches for an exact match for the specified language including any language localization. If no exact match is found, it tries to match the language family. If a match is still not found, the service returns the directions using the default language of the server's operating system. For example, if the directions language is specified as es-MX (Mexican Spanish), the service will return the directions in Spanish, as it supports the es language code, not es-MX.

directions_distance_units

Allowed values: Feet, Kilometers, Meters, Miles, NauticalMiles, Yards

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:

directions_style_name

Allowed values: NA Desktop, NA Navigation

Specify the name of the formatting style for the directions. This parameter can be specified using the following values:

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

This parameter applies only when the populate_directions parameter is set to true.

save_route_data

Specify whether the service will create a .zip file that contains a file geodatabase with the inputs and outputs of the analysis in a format that can be used to share route layers with your portal.

  • true—The route data will be saved as a .zip file. This file can be downloaded from the URL provided as part of the output_route_data parameter.
  • false—The route data will not be saved.

save_output_network_analysis_layer

Specify whether the service will save the analysis settings as a network analysis layer file.

You cannot work directly with this file even when you open the file in an ArcGIS Desktop application such as ArcGIS Pro. It is meant to be sent to Esri Technical Support to diagnose the quality of results returned from the service.

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

  • false—The network analysis layer file will not be saved.

output_format

type:enumdefault:Feature Set

Allowed values: Feature Set, JSON File, GeoJSON File

Specify the format in which the output features will be returned.

  • Feature Set—The output features will be returned as feature classes and tables.

  • JSON File—The output features will be returned as a compressed file containing the JSON representation of the outputs. When this option is specified, the output is a single file (with a .zip extension) that contains one or more JSON files (with a .json extension) for each of the outputs created by the service.

  • GeoJSON File—The output features will be returned as a compressed file containing the GeoJSON representation of the outputs. When this option is specified, the output is a single file (with a .zip extension) that contains one or more GeoJSON files (with a .geojson extension) for each of the outputs created by the service.

context

This parameter contains additional settings that affect task operation, for example, the spatial reference of the output features.

overrides

ignore_invalid_locations

Specify whether invalid input locations will be ignored.

  • true—Network locations that are unlocated will be ignored and the analysis will run using valid network locations only. The analysis will also continue if locations are on non-traversable elements or have other errors. This is useful if you know the network locations are not all correct, but you want to run the analysis with the network locations that are valid.
  • false—Invalid locations will not be ignored. Do not run the analysis if there are invalid locations. Correct the invalid locations and rerun the analysis.

Response details

On successful completion, the service returns the best paths between the stops and the status indicating whether the analysis was successful using the output parameters described below.

out_stops

Provides access to the attributes of the stops that are visited by the routes as well as stops that cannot be reached by any of the routes.

The following table list the fields returned for output stops. In addition to these fields, the parameter also includes all the fields from the input feature class used as stops for the analysis.

You can use the attributes from this parameter, such as the Status field, to determine why a stop was not assigned to any routes.

Show attributes for output_stops output parameter
  • Namestring (length: 500)

    The name of the stop visited by the route. The values for this field are copied from the Name field on the input stops.

  • RouteNamestring (length: 1024)nullable

    The name of the route to which the stop is assigned.

    Input stops that have the same route name at the time the tool runs are grouped together and visited by one route, and the route is assigned that name. When more than one route name is present on the input stops, the tool can output multiple routes—one for each unique route name.

    If no name is present, all the stops belong to the same route.

  • Sequenceinteger

    The order in which the stops are visited by the assigned route, which is listed in the RouteName field.

  • TimeWindowStartdatetimenullable

    The earliest time the route can visit the stop. The values for this field are copied from the TimeWindowStart field on the input stops.

  • TimeWindowEnddatetimenullable

    The latest time the route can visit the stop. The values for this field are copied from the TimeWindowEnd field on the input stops.

  • ArriveCurbApproachintegernullable

    The side of the vehicle the curb is on when arriving at the stop.

  • DepartCurbApproachintegernullable

    The side of the vehicle the curb is on when departing from the stop.

  • ArriveTimedatetimenullable

    The date and time value indicating the arrival time at the stop. The time zone for this time-of-day value is taken from the network element on which the stop is located.

  • DepartTimedatetimenullable

    The date and time value indicating the departure time from the stop. The time zone for this time-of-day value is taken from the network element on which the stop is located.

  • ArriveTimeUTCdatetimenullable

    The date and time value indicating the arrival time in coordinated universal time (UTC)

  • DepartTimeUTCdatetimenullable

    The date and time value indicating the departure time in coordinated universal time (UTC)

  • LocationTypeint enumdefault:0

    The stop type. The values for this field are copied from the LocationType field on the input stops.

  • SourceIDinteger (non-negative)nullable

    The numeric identifier of the network dataset source feature class on which the input point is located.

  • SourceOIDinteger (non-negative)nullable

    The object ID of the feature in the source on which the input point is located.

  • PosAlongnumber (non-negative)nullable

    The position along the digitized direction of the source line feature. This value is stored as a ratio. This attribute is null if the network location references a junction.

  • SideOfEdgeint enum

    Allowed values: 1, 2

    The side of the edge in relation to the digitized direction of the line feature.

    This attribute is limited to a domain of two values:

    • 1: Right Side
    • 2: Left Side
  • CurbApproachint enumdefault:0

    The direction a vehicle may arrive at and depart from the stop. The values for this field are copied from the CurbApproach field on the input stops.

  • Statusint enum

    Allowed values: 0, 1, 2, 3, 4, 5, 6, 7

    Indicates the status of the point with respect to its location on the network and the outcome of the analysis. The possible values are as following:

    • 0: OK.The point was located on the network.
    • 1: Not Located. The point was not located on the network and was not included in the analysis.
    • 2: Network element not located. The network element identified by the point's network location fields cannot be found. This can occur when a network element where the point should be was deleted, and the network location was not recalculated.
    • 3: Element not traversable. The network element that the point is located on is not traversable. This can occur when the element is restricted by a restriction attribute.
    • 4: Invalid Field Values. Field values fall outside a range or coded-value domain. For example, a negative number exists where positive numbers are required.
    • 5: Not reached. The point cannot be reached by the solver. The point may be on a separate, disconnected area of the network from the other inputs, or barriers or restrictions prevent travel to or from the point.
    • 6: Time window violation. The point could not be reached within the designated time windows. This status only applies to network analysis types that support time windows.
    • 7: Not located on closest. The closest network location to the point is not traversable because of a restriction or barrier, so the point has been located on the closest traversable network feature instead. If time windows are used and the route arrives early or late, the value changes to 6 (Time window violation)
  • SnapXnumber (non-negative)

    The x-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

  • SnapYnumber (non-negative)

    The y-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset.

  • SnapZnumber (non-negative)

    The z-coordinate of the position on the network dataset where the point was located, in the coordinate system of the network dataset. The SnapZ attribute is 0 if the network is two-dimensional.

  • DistanceToNetworkInMetersnumber (non-negative)

    The distance in meters between the point's geographic location and the position where it was located on the network.

  • AdditionalTimenumber (non-negative)nullable

    The amount of time added to the total route time when this stop is visited. The values for this field are copied from the AdditionalTime field on the input stops.

  • AdditionalDistancenumber (non-negative)nullable

    The amount of distance added to the total route distance when this stop is visited. The values for this field are copied from the AdditionalDistance field on the input stops.

  • AdditionalCostnumber (non-negative)nullable

    The cost added to the total route cost when this stop is visited. The values for this field are copied from the AdditionalCost field on the input stops. This field is included only when the travel mode used for the analysis has an impedance attribute that is neither time-based nor distance-based.

  • Cumul_Minutesnumber (non-negative)nullable

    The cumulative duration of the route in minutes from the origin to and including the stop. The value reported here is the cumulative route time to the stop, including any additional time at the stop and at any previous stops.

    For example, if a route analysis determines that it takes 10 minutes to visit two stops, and the second stop has an AdditionalTime value of 5, the Cumul_Minutes value will be 15 minutes.

  • Cumul_Milesnumber (non-negative)nullable

    The cumulative distance of the route in miles from the origin to and including the stop. The value reported here is the cumulative route distance to the stop, including any additional distance at the stop and at any previous stops.

  • Cumul_Kilometersnumber (non-negative)nullable

    The cumulative distance of the route in kilometers from the origin to and including the stop. The value reported here is the cumulative route distance to the stop, including any additional distance at the stop and at any previous stops.

  • Cumul_Costnumber (non-negative)nullable

    The cumulative cost of the route from the origin to and including the stop. The value reported here is the cumulative route cost to the stop, including any additional cost at the stop and at any previous stops. This field is included only when the travel mode used for the analysis has an impedance attribute that is neither time based nor distance based. The value is in unknown units.

  • Wait_Minutesnumber (non-negative)nullable

    This field stores the time spent waiting for the time window to open when the route arrives early at the stop.

    The field has a null value if time windows are not used in the analysis.

  • CumulWait_Minutesnumber (non-negative)nullable

    This field stores the sum of how much time has been spent waiting for time windows to open. It measures idle time. It includes the wait time from the current stop and all previous stops visited by the route.

    The field has a null value if time windows are not used in the analysis.

  • Violation_Minutesnumber (non-negative)nullable

    This field is a measure of how late the route arrived after the time window closed. Specifically, it stores the amount of time between the end of the time window and when the route arrived at the stop.

    The field has a null value if time windows are not used in the analysis.

  • CumulViolation_Minutesnumber (non-negative)nullable

    This field stores the cumulative violation time from the current stop and all previous stops visited by the route.

    The field has a null value if time windows are not used in the analysis.

  • ORIG_FIDintegernullable

    The ObjectID value of the input stop. This field can be used to join attributes from the output stops to the input stops or from the input stops to the output stops.

  • Bearingnumber (non-negative)nullable

    The values for this field are copied from the Bearing field on the input stops.

  • BearingTolnumber (non-negative)nullable

    The values for this field are copied from the BearingTol field on the input stops.

  • NavLatencynumber (non-negative)nullable

    The values for this field are copied from the NavLatency field on the input stops.

Example:

The following shows an example of the output_stops output parameter.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
{
  "paramName": "output_stops",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "displayFieldName": "",
    "geometryType": "esriGeometryPoint",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "fields": [
      {
        "name": "OID",
        "type": "esriFieldTypeOID",
        "alias": "OID"
      },
      {
        "name": "Name",
        "type": "esriFieldTypeString",
        "alias": "Name",
Expand

output_route_edges

Provides access to the individual network edges along which the routes travel.

This parameter has value only when the populate_route_edges parameter is set to true.

Show attributes for output_route_edges output parameter
  • SourceNamestring (length: 500)nullable

    The name of the edge source feature class from which the line was generated.

  • SourceOIDintegernullable

    The ObjectID value of the traversed street feature. Summarizing the values for this field can provide useful information such as the number of times a particular street feature is included in all the routes.

  • RouteEdgeIDintegernullable

    The ID representing the edge that comprises the street feature. Since there can be more than one edge per street feature, the SourceOID field can be used to uniquely identify the traversed street feature, and the RouteEdgeID field can be used to uniquely identify the edge within the traversed street feature.

  • FromPositionintegernullable

    Specifies where the output RouteEdges feature begins in reference to the digitized direction of the underlying street feature.

    • 0 (zero) indicates that the line begins at the from point of the underlying street feature.
    • 1 indicates that the line begins at the to point of the street feature.
    • A value between 0 and 1 indicates that the line begins at a point along the underlying street feature; for example, a value of 0.25 means the line begins 25 percent along the digitized direction of the underlying street feature.
  • ToPositionintegernullable

    Specifies where the output RouteEdges feature ends in reference to the digitized direction of the underlying street feature.

    • 0 indicates that the line ends at the from point of the underlying street feature.
    • 1 indicates that the line ends at the to point of the street feature.
    • A value between 0 and 1 indicates that the line ends at a point along the underlying street feature; for example, a value of 0.25 means the line ends 25 percent along the digitized direction of the underlying street feature.
  • RouteIDintegernullable

    Uniquely identifies the route that traversed the edge.

    The RouteID value corresponds to an ObjectID value from the output routes.

  • Attr_Minutesnumber (non-negative)nullable

    The travel time in minutes of the traversed portion of the underlying street feature.

  • Attr_Milesnumber (non-negative)nullable

    The length in miles of the traversed portion of the underlying street feature.

  • Attr_Kilometersnumber (non-negative)nullable

    The length in kilometers of the traversed portion of the underlying street feature.

  • Attr_Othernumber (non-negative)nullable

    The travel cost of the traversed portion of the underlying street feature. This field is included only when the travel mode used for the analysis has an impedance attribute that is neither time-based nor distance-based. The value is in unknown units.

  • Cumul_Minutesnumber (non-negative)nullable

    The travel time in minutes of the route from its origin to the end of the traversed portion of this underlying street feature.

  • Cumul_Milesnumber (non-negative)nullable

    The length in miles of the route from its origin to the end of the traversed portion of this underlying street feature.

  • Cumul_Kilometersnumber (non-negative)nullable

    The length in kilometers of the route from its origin to the end of the traversed portion of this underlying street feature.

  • Cumul_Othernumber (non-negative)nullable

    The travel cost of the route from its origin to the end of the traversed portion of this underlying street feature. This field is included only when the travel mode used for the analysis has an impedance attribute that is neither time-based nor distance-based. The value is in unknown units.

  • Attr_[SoftRestrictionsAttributeName]number (non-negative)nullable

    Specifies whether the traversed edge used the soft restriction attribute referred to in this field's name.

    0—The traversed edge didn't use the soft restriction. 1—The traversed edge used the soft restriction.

    For example, if the analysis was performed using the soft restriction called Avoid Toll Roads, a field called Attr_Avoid_Toll_Roads is created for this soft restriction. A value of 1 for this field would represent the toll roads in the route.

Example

The following shows an example of the output_route_edges output parameter.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
  "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",
Expand

out_routes

Provides access to the resulting routes.

Show attributes for output_routes output parameter
  • Namestring (length: 1024)

    The name of the route based on the RouteName field of the associated stops. If the input RouteName field is null, the name is derived from the Name field of the first and last stops.

  • StopCountinteger

    The number of stops assigned to the route.

  • StartTimedatetimenullable

    The start time of the route, reported in the time zone in which the first stop is located.

  • EndTimedatetimenullable

    The end time of the route, reported in the time zone in which the last stop is located.

  • StartTimeUTCdatetimenullable

    The start time of the route in coordinated universal time (UTC).

  • EndTimeUTCdatetimenullable

    The end time of the route in coordinated universal time (UTC).

  • FirstStopIDinteger

    The ObjectID value of the first stop on the route. This field is often used to join information from input stops to routes.

  • LastStopIDinteger

    The ObjectID value of the last stop on the route. This field is often used to join information from input stops to routes.

  • Total_Minutesnumber (non-negative)nullable

    The cumulative travel time in minutes from the beginning of the first stop to the end of the last stop for a route. This includes any AdditionalTime values for the visited stops if specified.

  • Total_Milesnumber (non-negative)nullable

    The cumulative travel distance in miles from the beginning of the first stop to the end of the last stop for a route. This includes any AdditionalDistance values for the visited stops if specified.

  • Total_Kilometersnumber (non-negative)nullable

    The cumulative travel distance in kilometers from the beginning of the first stop to the end of the last stop for a route. This includes any AdditionalDistance values for the visited stops if specified.

    Additional fields, Total_[AccumulateAttributeName]_Other, are included for each cost attribute that is neither time based nor distance based and accumulated during the analysis.

  • Total_Othernumber (non-negative)nullable

    The cumulative travel cost in unknown units from the beginning of the first stop to the end of the last stop for a route. This includes any AdditionalCost values for the visited stops if specified.

    This field is included only when the travel mode used for the analysis has an impedance attribute that is neither time based nor distance based.

  • TotalWait_Minutesnumber (non-negative)nullable

    This field stores the route's overall wait time, which is the time spent at stops waiting for time windows to open.

    The field has a null value if time windows are not used in the analysis.

  • TotalViolation_Minutesnumber (non-negative)nullable

    This field stores the route's overall violation time at stops. Violation time is added when the route arrives at a stop after the time window has ended; it's the difference between the ArriveTime and TimeWindowEnd field values on inputs stops.

    The field has a null value if time windows are not used in the analysis.

Example:

The following shows an example of the output_routes parameter.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
  "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",
Expand

out_directions

Provides access to the turn-by-turn directions for each resulting route.

The directions_language, directions_distance_units, and directions_style_name parameters highly influence the driving directions. The features are empty if the populate_directions parameter is false.

Show attributes for output directions
  • RouteNamestring (length: 500)nullable

    The name of the route to which the driving action applies. This value is the same as the Name field of the output routes.

  • ArriveTimedatetimenullable

    The time of day to initiate the given driving action. If the route spans multiple days, the date and time of day are displayed.

  • Typeintegernullable

    The type of maneuver that the directions feature represents or the type of the directions text. To determine whether Type refers to a maneuver type or a directions string type, review the SubItemType field value.

    Type can be used, for example, to assign an icon for direction text based on the maneuver type, or it can use a formatting style based on the directions string type when displaying the driving directions in the application.

    See Maneuver Types
    • 0: Unknown
    • 1: Arrive at Stop
    • 2: Go straight
    • 3: Bear left
    • 4: Bear right
    • 5: Turn left
    • 6: Turn right
    • 7: Make sharp left
    • 8: Make sharp right
    • 9: Make U-turn
    • 10: Take ferry
    • 11: Take roundabout
    • 12: Merge to highway
    • 13: Exit highway
    • 14: Go on another highway
    • 15: At fork keep center
    • 16: At fork keep left
    • 17: At fork keep right
    • 18: Depart stop
    • 19: Trip planning item
    • 20: End of ferry
    • 21: Ramp right
    • 22: Ramp left
    • 23: Turn left and immediately turn right
    • 24: Turn right and immediately turn left
    • 25: Turn right and immediately turn right
    • 26: Turn left and immediately turn left
    • 27: Pedestrian ramp
    • 28: Elevator
    • 29: Escalator
    • 30: Stairs
    • 31: Door passage
    See Directions String Types
    • 0: General directions string type
    • 1: Depart directions string type
    • 2: Arrive directions string type
    • 3: Length directions string type
    • 4: Time directions string type
    • 5: Time summary directions string type
    • 6: Time Window directions string type
    • 7: Violation Time directions string type
    • 8: Wait Time directions string type
    • 9: Service Time directions string type
    • 10: Estimated Arrival Time directions string type
    • 11: Cumulative Length directions string type
    • 12: Street name directions string type
    • 13: Alternate street name directions string type
    • 14: Sign branch information directions string type
    • 15: Sign toward information directions string type
    • 16: Cross street name directions string type
    • 17: Sign exit number directions string type
  • SubItemTypeintegernullable

    Specifies whether the Type field refers to an integer from the Directions String Types table or the Maneuver Types table.

    • If the SubItemType value is 1, the Type field refers to the values from the Maneuver Types table.
    • If the SubItemType value is 2, the Type field refers to the values from the Directions String Types table.
    • If the SubItemType value is 3, the Type field refers to the values from the Directions String Types table.
  • Textstring (length: 500)nullable

    A text description of the travel directions.

  • ElaspsedTimeintegernullable

    The time elapsed in minutes from when the current driving direction starts until the next one starts, or until the route ends for the last driving direction.

  • DriveDistanceintegernullable

    The distance from where the current driving direction occurs to where the next one occurs, or to where the route ends for the last driving direction.

    The value is in the units specified by the directions_distance_units parameter.

    This value is zero for driving directions that occur at the same location where the next one begins. For example, the DriveDistance value is 0 for the directions text at the start of the route.

Example

The following shows an example of the output directions.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
  "paramName": "Output_Directions",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "displayFieldName": "",
    "geometryType": "esriGeometryPolyline",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "RouteName",
        "type": "esriFieldTypeString",
        "alias": "RouteName",
Expand

output_direction_lines

Specifies the output route lines calculated in the analysis sliced to represent each route segment between DirectionPoints events or maneuver locations.

Show attributes for output_direction_lines output parameter
  • DirectionPointIDintegernullable

    The ObjectID of the feature in the output_direction_points with which this line is associated.

  • RouteIDintegernullable

    The ObjectID of the output output_routes feature with which this direction line is associated.

  • DirectionLineTypeintegernullable

    The type of direction situation described by this line, designated by one of the following values:

    Show values
    • Unknown (0)
    • Segment (1)
    • Maneuver Segment (2)
    • Restriction Violation (3)
    • Scaled Cost Barrier (4)
    • Heavy Traffic (5)
    • Slow Traffic (6)
    • Moderate Traffic (7)
  • Metersnumber (non-negative)nullable

    The length of the line segment measured in meters.

  • Minutesnumber (non-negative)nullable

    The travel time along the line segment in minutes.

  • FromLevelintegernullable

    The building level at which this direction event begins. This value corresponds to the Level property defined in the network dataset used for the analysis.

  • ToLevelintegernullable

    The building level at which this direction event ends. This value corresponds to the Level property defined in the network dataset used for the analysis.

Example

The following shows an example of the output direction lines.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
  "paramName": "output_direction_lines",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "displayFieldName": "",
    "geometryType": "esriGeometryPolyline",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "DirectionPointID",
        "type": "esriFieldTypeInteger",
        "alias": "Direction Point ID"
Expand

output_direction_points

Specifies the output turn-by-turn directions for the routes calculated in the analysis, represented as point locations along the routes where specific direction events or maneuvers occur.

Show attributes for output_direction_points output parameter
  • RouteIDintegernullable

    The ObjectID of the output output_routes feature with which this direction point is associated.

  • Sequenceintegernullable

    The sequence of the direction points for the route, starting with 1.

  • DirectionPointTypeintegernullable

    The type of direction event or maneuver described by the point, designated by one of the values below:

    Show values
    • Header (1)
    • Arrive (50)
    • Depart (51)
    • Straight (52)
    • On Ferry (100)
    • Off Ferry (101)
    • Central Fork (102)
    • Roundabout (103)
    • U-Turn (104)
    • Door (150)
    • Stairs (151)
    • Elevator (152)
    • Escalator (153)
    • Pedestrian Ramp (154)
    • Left Fork (200)
    • Left Ramp (201)
    • Clockwise Roundabout (202)
    • Left-handed U-turn (203)
    • Bear left (204)
    • Left Turn (205)
    • Sharp Left (206)
    • Left Turn and immediate Left Turn (207)
    • Left Turn and immediate Right Turn (208)
    • Right Fork (300)
    • Right Ramp (301)
    • Counter-Clockwise Roundabout (302)
    • Right-handed U-turn (303)
    • Bear right (304)
    • Right Turn (305)
    • Sharp Right (306)
    • Right Turn and immediate Left Turn (307)
    • Right Turn and immediate Right Turn (308)
    • Up Elevator (400)
    • Up Escalator (401)
    • Up Stairs (402)
    • Down Elevator (500)
    • Down Escalator (501)
    • Down stairs (502)
    • General Event (1000)
    • Landmark (1001)
    • Time Zone Change (1002)
    • Traffic Event (1003)
    • Scaled Cost Barrier Event (1004)
    • Boundary Crossing (1005)
    • Restriction Violation (1006)
    • Lane (1007)
  • StopIDintegernullable

    The ObjectID of the stop with which this direction point is associated, if any. If the point does not represent a visit to a stop, the value is null.

  • DisplayTextstring (length: 1024)nullable

    The directions text to display in the consuming application.

  • ArrivalTimedatetimenullable

    The time the direction event occurs in coordinated universal time (UTC).

  • ArrivalUTCOffsetnumber (non-negative)nullable

    The difference in minutes between the local time at the maneuver location and UTC time shown in the ArrivalTime field.

  • Namestring (length: 1024)nullable

    The name of the direction point.

  • ExitNamestringnullable

    The highway exit name that appears in the directions instruction.

  • AlternateNamestringnullable

    The alternate source name that appears in the directions instruction.

  • IntersectingNamestringnullable

    The name of the intersecting or cross street that appears in the directions instruction.

  • BranchNamestringnullable

    The signpost branch name that appears in the directions instruction.

  • TowardNamestringnullable

    The signpost toward destination name that appears in the directions instruction.

  • Levelintegernullable

    The building level at which this direction event occurs. This value corresponds to the Level property defined in the network dataset used for the analysis.

  • ShortVoiceInstructionstring (length: 1024)nullable

    The short text to use as voice guidance text in the consuming application.

  • VoiceInstructionstring (length: 1024)nullable

    The additional text, including expanded abbreviations and plurals, to use as voice guidance text in the consuming application.

  • Azimuthnumber (non-negative)nullable

    The bearing in degrees of the vehicle departing this point. Zero indicates north.

Example

The following shows an example of the output direction points.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
{
  "paramName": "output_direction_points",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "displayFieldName": "",
    "geometryType": "esriGeometryPoint",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "fields": [
      {
        "name": "ObjectID",
        "type": "esriFieldTypeOID",
        "alias": "ObjectID"
      },
      {
        "name": "RouteID",
        "type": "esriFieldTypeInteger",
        "alias": "Route ID"
Expand

usage_cost

This parameter returns the credits used by the analysis.

Example

The following shows an example of the usage_cost parameter in which the analysis generated 9 billable objects (represented by numObjects ) and 4.5 credits were used by the analysis.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "paramName": "Usage_Cost",
  "dataType": "GPString",
  "value": {
    "numObjects": 9,
    "credits": 4.5
  }
}

solve_succeeded

Determine if the service was able to complete successfully. The error messages for the failure can be obtained by making a request to get the status of the job.

Example

The following shows an example of the solve_succeeded parameter

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "paramName": "solve_succeeded",
  "dataType": "GPBoolean",
  "value": true
}

out_route_data

Provides access to a .zip file that contains a file geodatabase containing the inputs and outputs of the analysis in a format that can be used to share route layers with ArcGIS Online or Portal for ArcGIS. The parameter value is populated only when the save_route_data parameter is set to true.

out_result_file

Use this parameter to access the results from the analysis as a .zip file containing one or more files for each output. The format of the individual file is specified by the Output Format parameter. The parameter value is not populated when the output_format parameter is set to Feature Set.

out_network_analysis_layer

Provides access to the network analysis layer file that stores the analysis settings and the inputs and outputs used for the analysis. The parameter value is populated only when the save_output_network_analysis_layer parameter is set to True.

Examples

Routing between two points

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

The first request submits a job and returns the job id.

Request

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
POST https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob? HTTP/1.1
Content-Type: application/x-www-form-urlencoded

f=json
&token=<ACCESS_TOKEN>
&stops={
    "features":[
        {"attributes":{"Name":"Stop1"
        },
        "geometry":{
            "x":145.0657306480001,
            "y":-37.86513493399997
            }
        },
        {"attributes":{"Name":"Stop2"
        },"
        geometry":{
            "x":145.1049567670001,
            "y":-37.81866925199995
            }
Expand

Response (JSON)

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "jd6f6b61f07654f5aa5ef1b2392384e67",
  "jobStatus": "esriJobSubmitted"
}

Service limits

The table below lists the limits that apply to this route service.

Limit descriptionLimit 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.)

27 miles (43.45 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 use_hierarchy is set to false.)

50 miles (80.46 kilometers)

Maximum time a client can use the 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

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.