Routing

A route and turn-by-turn directions for two points created with the routing service

What is routing?

Routing is the process of finding the best path from an origin to a destination in a street network. Routing takes into consideration many different data parameters in the street network such as speed limit, number of lanes, and time of day. Routing can also take into consideration other real-time data such as road conditions, accidents, and other barriers.

You can use routing to build applications that:

  • Find the shortest path from an origin to a destination
  • Find the quickest path to multiple destinations
  • Determine the best sequence to visit multiple destinations
  • Generate driving directions in multiple languages

How routing works

The typical workflow for creating a route is to:

  1. Define the origin, and stops, and destination.
  2. Define the type of travel for the route.
  3. Call the service to find the route features and directions.

URL requests

You can find a route and directions by making an HTTPS request to the routing service solve operation or by using client APIs. Specify the origin, destination, and optionally, additional parameters to refine the results with directions. Some of the most common parameters are described provided below.

Direct and job

The service supports both direct and job requests. Both Direct and Job request types support all of the capabilities of the service, however, Direct is better suited for shorter requests, and Job is better suited for longer, more complex requests.

The request you choose depends on the complexity of the problem you are trying solve and limits of the request.

Request limits

LimitDirectJob
Maximum number of stops15010,000
Maximum transaction time:5 minutes60 minutes
Maximum number of point barriers:250250
Maximum number of street features intersected by polyline barriers:500500
Maximum number of street features intersected by polygon barriers:2,0002,000
Maximum straight-line distance for the walking travel mode: (If the straight-line distance between any stops is greater than this limit, the analysis will fail when the walking restriction is used.)27 miles (43.45 kilometers)27 miles (43.45 kilometers)
Force hierarchy beyond a straight-line distance of: (If the straight-line distance between any stops is greater than the limit shown here, the analysis uses hierarchy, even if the travel_mode defines not to use hierarchy.)50 miles (80.46 kilometers)50 miles (80.46 kilometers)
Maximum snap tolerance: (If the distance between an input point and its nearest traversable street is greater than the distance specified here, the point is excluded from the analysis.)12.42 miles (20 kilometers)12.42 miles (20 kilometers)
Maximum number of directions features that can be returned:No limit1,000,000
Maximum number of route edges that can be returned:Not available1,000,000
Direct requestJob request

URL

 
1
https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?<parameters>

Use for shorter transactions with less than 150 stops that will complete in less than 5 minutes.

Key parameters

Name (Direct)DescriptionExamples
stopsThe two or more locations between which the route is to be found.stops=-117,34; -117.5,34.5
travelModeThe mode of transportation such as driving a car or a truck or walking.travelMode=JSON Object
startTimeThe time at which travel begins from the input stops. You can also specify a value of now, to set the depart time to the current time.startTime=now
findBestSequenceSpecify whether the service should find the best sequence when visiting multiple destinations.findBestSequence=true
returnDirectionsGenerate driving directions for each route.returnDirections=true
directionsLanguageThe language to be used when generating driving directions.directionsLanguage=es

Additional parameters: Set additional constraints when finding routes such as temporary slowdowns using polygonBarriers or set outputLines to specify the type of route feature created by the service.

URL

 
1
https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob?<parameters>

Use for longer transactions with up to 10,000 stops that will complete in less than 60 minutes.

Key parameters

Name (Job)DescriptionExamples
stopsThe two or more locations between which the route is to be found.stops={"features":[{"geometry":{"x":-117,"y":34.5}},{"geometry":{"x":-117.5,"y":34.5}}]}
travel_modeThe mode of transportation such as driving a car or a truck or walking.travel_mode=JSON Object
time_of_dayThe time at which travel begins from the input stops.time_of_day=1608022800000
reorder_stops_to_find_optimal_routesSpecify whether the service should find the best sequence when visiting multiple destinations.reorder_stops_to_find_optimal_routes=true
populate_directionsGenerate driving directions for each route.populate_directions=true
directions_languageThe language to be used when generating driving directions.directions_language=es

Additional parameters: Set additional constraints when finding routes such as temporary slowdowns using polygon_barriers, set route_shape to specify the type of route feature created by the service, or set return_to_start if start and end location for your route is same.

Examples

Direct: Find a route and directions

In this example, use the routing service to find a route between a set of stops that accounts for current traffic conditions and generate driving directions in Spanish.

To find a route, you need to define at least two stops to visit. The default travelMode is driving time by vehicle, but you can use walk or trucking travel modes as well. It is always good to provide the startTime to get the best results. In this example, we specify startTime as now which sets the route departure time as the current time and also indicates to the service that the route should use the current traffic conditions. We also set the directionsLanguage to generate driving directions in our language of choice.

The response contains a set of ordered stops to visit, the route segments, and turn-by-turn text directions.

APIs

ArcGIS JS APIEsri LeafletMapbox GL JSOpenLayersArcGIS REST JSArcGIS .NET APIArcGIS Android APIArcGIS iOS APIArcGIS Java APIArcGIS Qt API (C++)ArcGIS Qt API (QML)ArcGIS Python API
                                                                                                                                                                             
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
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>ArcGIS JavaScript Tutorials: Find a route and directions (Auth)</title>
  <style>
    html, body, #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    .directions {
    	position: fixed;
    	right: 15px;
      max-height: calc(100% - 45px) !important;
  </style>

  <link rel="stylesheet" href="https://js.arcgis.com/4.20/esri/themes/light/main.css">
  <script src="https://js.arcgis.com/4.20/"></script>

  <script>
    require([
      "esri/Map",
      "esri/views/MapView",
      "esri/Graphic",
      "esri/geometry/Point",
      "esri/rest/route",
      "esri/rest/support/RouteParameters",
      "esri/rest/support/FeatureSet",
      "esri/config"
    ],(Map, MapView, Graphic, Point, route, RouteParameters, FeatureSet, esriConfig)=> {
      const apiKey = "YOUR_API_KEY";
      const map = new Map({
        basemap: "arcgis-navigation"
      const center = new Point ([-122.62,45.526201]);
      const origin = new Point([-122.690176,45.522054]);
      const stop =  new Point([-122.614995,45.526201]);
      const destination = new Point([-122.68782,45.51238]);
      const view = new MapView({
        container: "viewDiv",
        map: map,
        center: center,
        zoom: 12,
        constraints: {
          snapToZoom: false
      view.when(()=>{
        addGraphic("start", origin);
        addGraphic("stop", stop);
        addGraphic("finish", destination);
      view.on("click", (event)=>{
        if (view.graphics.length === 0) {
          addGraphic("start", event.mapPoint);
        } else if (view.graphics.length === 1) {
          addGraphic("stop", event.mapPoint);
        } else if (view.graphics.length === 2) {
          addGraphic("finish", event.mapPoint);
        } else {
          view.ui.empty("top-right");
          addGraphic("start",event.mapPoint);
      function addGraphic(type, point) {
        let color = "#ffffff";
        let outlineColor = "#000000"
        let size = "12px";
        if (type == "start") {
          color = "#ffffff";
        } else if (type == "stop") {
          color = "#000000";
          outlineColor = "#ffffff";
          size = "8px";
        } else {
          color = "#000000";
          outlineColor = "#ffffff";
        const graphic = new Graphic({
          symbol: {
            type: "simple-marker",
            color: color,
            size: size,
            outline: {
              color: outlineColor,
              width: "1px"
          geometry: point
      function getRoute() {

        const routeUrl = "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World";

        const routeParams = new RouteParameters({
          stops: new FeatureSet({
            features: view.graphics.toArray()
          }),
          returnDirections: true,
          directionsLanguage: "es"
        });

        route.solve(routeUrl, routeParams)
          .then((data)=> {
            if (data.routeResults.length > 0) {
              showRoute(data.routeResults[0].route);
              showDirections(data.routeResults[0].directions.features);
            }
          })
          .catch((error)=>{
            console.log(error);
          })
      }
      function showRoute(routeResult) {
          type: "simple-line",
          color: [5, 150, 255],
          width: 3
        view.graphics.add(routeResult,0);
      function showDirections(directions) {
        function showRouteDirections(directions) {
          const directionsList = document.createElement("ol");
          directions.forEach(function(result,i){
            const direction = document.createElement("li");
            direction.innerHTML = result.attributes.text + ((result.attributes.length > 0) ? " (" + result.attributes.length.toFixed(2) + " miles)" : "");
        const directionsElement = document.createElement("div");
        directionsElement.innerHTML = "<h3>Directions</h3>";
        directionsElement.classList = "esri-widget esri-widget--panel esri-directions__scroller directions";
        directionsElement.style.marginTop = "0";
        directionsElement.style.padding = "0 15px";
        directionsElement.style.minHeight = "365px";
        view.ui.empty("top-right");
        view.ui.add(directionsElement, "top-right");
  </script>
</head>
<body>
  <div id="viewDiv"></div>
</body>
</html>

REST API

RequestResponse
cURLHTTP
       
1
2
3
4
5
6
7
curl https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve? \
-d "f=json"
-d "token=<ACCESS_TOKEN>"
-d "stops=-122.68782,45.51238;-122.690176,45.522054;-122.614995,45.526201"
-d "startTime=now"
-d "returnDirections=true"
-d "directionsLanguage=es"
                                                                                                         
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
{
  "routes": {
    "fieldAliases": {
      // one or more field aliases
    },
    "geometryType": "esriGeometryPolyline",
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "features": [
      {
        "attributes": {
          "Name": "Location 1 - Location 3",
          "Total_TravelTime": 14.758,
          "Total_Miles": 5.491,
          "Total_Kilometers": 8.837
          // more field values
        },
        "geometry": {
          "paths": [
            [
              [
                -122.68838,
                45.51262
              ]
              // additional points that make up the path geometry between location 1 and location 2

            ],
            [
              [
                -122.69019,
                45.52206
              ]
              // additional points that make up the path geometry between location 2 and location 3

            ]
          ]
        }
      }
    ]
  },
  "directions": [
    {
      "routeId": 1,
      "routeName": "Location 1 - Location 3",
      "summary": {
        "totalLength": 5.491,
        "totalTime": 14.758,
        "totalDriveTime": 14.758,
        "envelope": {
          "xmin": -122.69257,
          "ymin": 45.51262,
          "xmax": -122.61497,
          "ymax": 45.53422,
          "spatialReference": {
            "wkid": 4326,
            "latestWkid": 4326
          }
        }
      },
      "features": [
        {
          "attributes": {
            "length": 0,
            "time": 0,
            "text": "Salga desde Location 1",
            "ETA": 1607894119000,
            "arriveTimeUTC": 1607922919000,
            "maneuverType": "esriDMTDepart"
          },
          "compressedGeometry": "+gm5a9-1vvvvvh+nnn9tf+0+0",
          "strings": [
            {
              "string": "9:15 PM",
              "stringType": "esriDSTEstimatedArrivalTime"
            },
            {
              "string": "Location 1",
              "stringType": "esriDSTStreetName"
            }
          ]
        },
        {
          "attributes": {
            "length": 0.024,
            "time": 0.054,
            "text": "Vaya hacia el noreste",
            "ETA": 1607894119000,
            "arriveTimeUTC": 1607922919000,
            "maneuverType": "esriDMTStraight"
          },
          "compressedGeometry": "+gm5a9-1vvvvvh+nnn9tf+8a+j6+1h7+59i",
          "strings": [
            {
              "string": "9:15 PM",
              "stringType": "esriDSTEstimatedArrivalTime"
            }
          ]
        }
        // more direction features
      ]
    }
  ]
}

Job: Find multiple routes

In this example, you will find the travel time and travel distance for multiple routes operated by a long-haul logistics company.

  • We group a pair of stops that define a route by assigning them a unique RouteName value. This allows the service to find all the routes in a single request as compared to sending multiple requests for each route, thus improving the overall performance.

  • We specify the Trucking Time travel_mode since we are finding routes for trucks and not cars.

  • Since we are only interested in finding the travel time and travel distance for our routes and do not need the route geometry, we set the route_shape to None.

  • We also do not need driving directions for our routes. So we set the populate_directions to false.

APIs

ArcGIS Python API
                                                                                                                                                       
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
"""
Find the travel time and travel distance for multiple routes operated by a long-haul logistics company.
"""

import arcgis
import pandas as pd


def print_result(result):
    """Print useful information from the result."""
    pd.set_option("display.max_rows", None)
    pd.set_option("display.max_colwidth", None)

    print("\n-- Output Routes -- \n")
    print(result.output_routes.sdf[["Name", "Total_Minutes", "Total_Miles",
                                    "Total_Kilometers"]].to_string(index=False))


def main():
    """Program execution logic."""
    # inputs
    stops = {
        "features": [
            {
                "geometry": {
                    "x": -118.268579,
                    "y": 34.052291
                },
                "attributes": {
                    "Name": "Los Angeles, CA",
                    "RouteName": "Route A"
                }
            },
            {
                "geometry": {
                    "x": -74.009023,
                    "y": 40.709975
                },
                "attributes": {
                    "Name": "New York, NY",
                    "RouteName": "Route A"
                }
            },
            {
                "geometry": {
                    "x": -87.648549,
                    "y": 41.758688
                },
                "attributes": {
                    "Name": "Chicago, IL",
                    "RouteName": "Route B"
                }
            },
            {
                "geometry": {
                    "x": -122.320028,
                    "y": 47.591046
                },
                "attributes": {
                    "Name": "Seattle, WA",
                    "RouteName": "Route B"
                }
            },
            {
                "geometry": {
                    "x": -71.057477,
                    "y": 42.359483
                },
                "attributes": {
                    "Name": "Boston, MA",
                    "RouteName": "Route C"
                }
            },
            {
                "geometry": {
                    "x": -95.368848,
                    "y": 29.759222
                },
                "attributes": {
                    "Name": "Houston, TX",
                    "RouteName": "Route C"
                }
            },
            {
                "geometry": {
                    "x": -80.220762,
                    "y": 25.761156
                },
                "attributes": {
                    "Name": "Miami, FL",
                    "RouteName": "Route D"
                }
            },
            {
                "geometry": {
                    "x": -122.651334,
                    "y": 45.51567
                },
                "attributes": {
                    "Name": "Portland, OR",
                    "RouteName": "Route D"
                }
            },
            {
                "geometry": {
                    "x": -112.074247,
                    "y": 33.446554
                },
                "attributes": {
                    "Name": "Phoenix, AZ",
                    "RouteName": "Route E"
                }
            },
            {
                "geometry": {
                    "x": -75.161557,
                    "y": 39.952057
                },
                "attributes": {
                    "Name": "Philadelphia, PA",
                    "RouteName": "Route E"
                }
            }
        ]
    }


    # Connect to the routing service
    api_key = "YOUR_API_KEY"
    arcgis.GIS("https://www.arcgis.com", api_key=api_key)

    # Get the trucking time travel mode defined for the portal. Fail if the travel mode is not found.
    truck_time_travel_mode = ""
    for feature in arcgis.network.analysis.get_travel_modes().supported_travel_modes.features:
        attributes = feature.attributes
        if attributes["AltName"] == "Trucking Time":
            truck_time_travel_mode = attributes["TravelMode"]
            break
    assert truck_time_travel_mode, "Trucking Time travel mode not found"

    # Call the routing service
    result = arcgis.network.analysis.find_routes(stops=stops,
                                                 travel_mode=truck_time_travel_mode,
                                                 populate_directions=False,
                                                 route_shape="None")
    print_result(result)



if __name__ == "__main__":
    main()

REST API

Unlike Direct request type which allows you to make a request and get back all the results in the response, when working with a Job request type, you need to follow a three step workflow:

  1. Make the submitJob request with the appropriate request parameters to get a job id.
  2. Using the job id, check the job status to see if the job completed successfully.
  3. Use the job id to get one or more results.
1. Submit job2. Check job status3. Get results (output_routes)
cURLHTTP
       
1
2
3
4
5
6
7
curl https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/submitJob? \
-d "f=json" \
-d "token=<ACCESS_TOKEN>" \
-d "stops={'features':[{'geometry':{'x':-118.268579,'y':34.052291},'attributes':{'Name':'Los Angeles, CA','RouteName':'Route A'}},{'geometry':{'x':-74.009023,'y':40.709975},'attributes':{'Name':'New York, NY','RouteName':'Route A'}},{'geometry':{'x':-87.648549,'y':41.758688},'attributes':{'Name':'Chicago, IL','RouteName':'Route B'}},{'geometry':{'x':-122.320028,'y':47.591046},'attributes':{'Name':'Seattle, WA','RouteName':'Route B'}},{'geometry':{'x':-71.057477,'y':42.359483},'attributes':{'Name':'Boston, MA','RouteName':'Route C'}},{'geometry':{'x':-95.368848,'y':29.759222},'attributes':{'Name':'Houston, TX','RouteName':'Route C'}},{'geometry':{'x':-80.220762,'y':25.761156},'attributes':{'Name':'Miami, FL','RouteName':'Route D'}},{'geometry':{'x':-122.651334,'y':45.51567},'attributes':{'Name':'Portland, OR','RouteName':'Route D'}},{'geometry':{'x':-112.074247,'y':33.446554},'attributes':{'Name':'Phoenix, AZ','RouteName':'Route E'}},{'geometry':{'x':-75.161557,'y':39.952057},'attributes':{'Name':'Philadelphia, PA','RouteName':'Route E'}}]}" \
-d "travel_mode={'attributeParameterValues':[{'attributeName':'Use Preferred Truck Routes','parameterName':'Restriction Usage','value':'PREFER_HIGH'},{'attributeName':'Avoid Unpaved Roads','parameterName':'Restriction Usage','value':'AVOID_HIGH'},{'attributeName':'Avoid Private Roads','parameterName':'Restriction Usage','value':'AVOID_MEDIUM'},{'attributeName':'Driving a Truck','parameterName':'Restriction Usage','value':'PROHIBITED'},{'attributeName':'Roads Under Construction Prohibited','parameterName':'Restriction Usage','value':'PROHIBITED'},{'attributeName':'Avoid Gates','parameterName':'Restriction Usage','value':'AVOID_MEDIUM'},{'attributeName':'Avoid Express Lanes','parameterName':'Restriction Usage','value':'PROHIBITED'},{'attributeName':'Avoid Carpool Roads','parameterName':'Restriction Usage','value':'PROHIBITED'},{'attributeName':'Avoid Truck Restricted Roads','parameterName':'Restriction Usage','value':'AVOID_HIGH'},{'attributeName':'TruckTravelTime','parameterName':'Vehicle Maximum Speed (km/h)','value':0}],'description':'Models basic truck travel by preferring designated truck routes, and finds solutions that optimize travel time. Routes must obey one-way roads, avoid illegal turns, and so on. When you specify a start time, dynamic travel speeds based on traffic are used where it is available, up to the legal truck speed limit.','distanceAttributeName':'Kilometers','id':'ZzzRtYcPLjXFBKwr','impedanceAttributeName':'TruckTravelTime','name':'Trucking Time','restrictionAttributeNames':['Avoid Carpool Roads','Avoid Express Lanes','Avoid Gates','Avoid Private Roads','Avoid Truck Restricted Roads','Avoid Unpaved Roads','Driving a Truck','Roads Under Construction Prohibited','Use Preferred Truck Routes'],'simplificationTolerance':10,'simplificationToleranceUnits':'esriMeters','timeAttributeName':'TruckTravelTime','type':'TRUCK','useHierarchy':true,'uturnAtJunctions':'esriNFSBNoBacktrack'}" \
-d "populate_directions=false" \
-d "route_shape=None" \
Response (JSON)
    
1
2
3
4
{
  "jobId": "j2b41de060e5d42d082b888d3be029253",
  "jobStatus": "esriJobSubmitted"
}
Request
cURLHTTP
   
1
2
3
curl https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/j2b41de060e5d42d082b888d3be029253? \
-d "f=json" \
-d "token=<ACCESS_TOKEN>"
Response (JSON)
                                                  
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
{
  "jobId": "j2b41de060e5d42d082b888d3be029253",
  "jobStatus": "esriJobSucceeded",
  "results": {
    "Solve_Succeeded": {
      "paramUrl": "results/Solve_Succeeded"
    },
    "Output_Routes": {
      "paramUrl": "results/Output_Routes"
    },
    "Output_Route_Edges": {
      "paramUrl": "results/Output_Route_Edges"
    },
    "Output_Directions": {
      "paramUrl": "results/Output_Directions"
    },
    "Output_Stops": {
      "paramUrl": "results/Output_Stops"
    },
    "Output_Network_Analysis_Layer": {
      "paramUrl": "results/Output_Network_Analysis_Layer"
    },
    "Output_Route_Data": {
      "paramUrl": "results/Output_Route_Data"
    },
    "Output_Result_File": {
      "paramUrl": "results/Output_Result_File"
    }
  },
  "inputs": {
    "Stops": {
      "paramUrl": "inputs/Stops"
    },
    "Route_Shape": {
      "paramUrl": "inputs/Route_Shape"
    },
    "Populate_Directions": {
      "paramUrl": "inputs/Populate_Directions"
    },
    "Travel_Mode": {
      "paramUrl": "inputs/Travel_Mode"
    }
  },
  "messages": [
    {
      "type": "esriJobMessageTypeWarning",
      "description": "Network elements with avoid-restrictions are traversed in the output (restriction attribute names: \"Avoid Private Roads\")."
    }
  ]
}
Request
cURLHTTP
   
1
2
3
curl https://logistics.arcgis.com/arcgis/rest/services/World/Route/GPServer/FindRoutes/jobs/j2b41de060e5d42d082b888d3be029253/results/Output_Routes? \
-d "f=json" \
-d "token=<ACCESS_TOKEN>"
Response (JSON)
                                                        
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
{
  "paramName": "Output_Routes",
  "value": {
    "fields": [
      // One or more field definitions
    ],
    "features": [
      {
        "attributes": {
          "Name": "Route A",
          "Total_Miles": 2802.1727702808216,
          "Total_Kilometers": 4509.6689541527276,
          "Total_Minutes": 2569.5486409677055
          // more field values
        }
      },
      {
        "attributes": {
          "Name": "Route B",
          "Total_Miles": 2123.5459789541665,
          "Total_Kilometers": 3417.5228149996442,
          "Total_Minutes": 1942.2562740678086
          // more field values
        }
      },
      {
        "attributes": {
          "Name": "Route C",
          "Total_Miles": 1858.4600032557835,
          "Total_Kilometers": 2990.9074372945502,
          "Total_Minutes": 1741.9289972140964
          // more field values
        }
      },
      {
        "attributes": {
          "Name": "Route D",
          "Total_Miles": 3270.1929177872121,
          "Total_Kilometers": 5262.8758768350972,
          "Total_Minutes": 2975.6605207300813
          // more field values
        }
      },
      {
        "attributes": {
          "Name": "Route E",
          "Total_Miles": 2392.4891536441355,
          "Total_Kilometers": 3850.3457651737981,
          "Total_Minutes": 2128.3869138049135
          // more field values
        }
      }
    ],
    "exceededTransferLimit": false
  }
}

Tutorials

Services

Routing service

Get turn-by-turn directions and solve advanced routing problems.

API support

RoutingFleet routingClosest facility routingService areasLocation-allocationTravel cost matrix
ArcGIS API for JavaScriptFully supportedAccess with geoprocessing taskFully supportedFully supportedAccess with geoprocessing taskAccess with geoprocessing task
ArcGIS Runtime API for AndroidFully supportedAccess with geoprocessing taskFully supportedFully supportedAccess with geoprocessing taskAccess with geoprocessing task
ArcGIS Runtime API for iOSFully supportedAccess with geoprocessing taskFully supportedFully supportedAccess with geoprocessing taskAccess with geoprocessing task
ArcGIS Runtime API for JavaFully supportedAccess with geoprocessing taskFully supportedFully supportedAccess with geoprocessing taskAccess with geoprocessing task
ArcGIS Runtime API for .NETFully supportedAccess with geoprocessing taskFully supportedFully supportedAccess with geoprocessing taskAccess with geoprocessing task
ArcGIS Runtime API for QtFully supportedAccess with geoprocessing taskFully supportedFully supportedAccess with geoprocessing taskAccess with geoprocessing task
ArcGIS API for PythonFully supportedFully supportedFully supportedFully supportedFully supportedFully supported
Esri LeafletAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JS
MapBox GL JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JS
OpenLayersAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JSAccess via ArcGIS REST JS
ArcGIS REST JSFully supportedFully supportedFully supportedFully supportedFully supportedFully supported
Full supportPartial support (see notes)Not supported

Tools

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