Service areas

Driving or walking time areas created for a location using the routing service

What is a service area?

A service area, also known as an isochrone, is a polygon that represents the distance that can be reached when driving or walking on a street network. This type of analysis is common in real estate search or determining the driving proximity to schools, businesses, or other facilities. For example, you can create a drive time polygon that represents how far you can drive in any direction from the center of a city in 20 minutes.

You can use service areas to build applications that:

  • Visualize and measure the accessibility of locations that provide some kind of service. For example, a three-minute drive-time polygon around a grocery store can determine which residents are able to reach the store within three minutes and are thus more likely to shop there.

  • By generating multiple service areas around one or more locations that can show how accessibility changes with an increase in travel time or travel distance. It can be used, for example, to determine how many hospitals are within 5, 10, and 15 minute drive times of schools.

  • When creating service areas based on travel times, the service can make use of traffic data, which can influence the area that can be reached during different times of the day.

How service areas work

The typical workflow for creating service areas is to define:

  1. One or more locations around which service areas are generated (facilities).
  2. The size and number of service areas to generate for each facility.
  3. Define the type of travel for the analysis.
  4. Call the service to generate service areas around facilities.

URL requests

You can generate service areas by making an HTTPS request to the Service Area service solveServiceArea operation or by using client APIs. Specify the one or more input facilities, and optionally, additional parameters to refine the operation. Some of the most common parameters are described provided below.

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn API key or OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<YOUR_API_KEY>
token=<ACCESS_TOKEN>

Direct

Use for shorter transactions with less than 100 facilities that will complete in less than 5 minutes.

Use dark colors for code blocksCopy
1
https://route-api.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World/solveServiceArea?<parameters>
Use dark colors for code blocksCopy
1
https://route.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World/solveServiceArea?<parameters>

Key parameters

Name (Direct)DescriptionExamples
facilitiesOne or more locations around which service areas are generated.facilities=-117,34
defaultBreaksThe size and number of service areas to generate for each facility.defaultBreaks=5,10,15
travelModeThe mode of transportation such as driving a car or a truck or walking.travelMode=JSON Object
travelDirectionThe direction of travel (away from facility or towards facility) that should be used when generating service areas.travelDirection=esriNATravelDirectionFromFacility
timeOfDayThe time to depart from or arrive at facilities. You can also specify a value of now, to set the depart or arrive time to current time.timeOfDay=now

Additional parameters: Exercise fine-grained control on how the service area polygons are generated by specifying outputPolygons, splitPolygonAtBreaks, overlapPolygons, and mergeSimilarPolygonRanges parameters.

Job

Use for longer transactions with up to 1,000 facilities that will complete in less than 2 hours.

Use dark colors for code blocksCopy
1
https://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/submitJob?<parameters>

Key parameters

Name (Job)DescriptionExamples
facilitiesOne or more locations around which service areas are generated.facilities={"features":[{"geometry":{"x":-117,"y":34.5}}]}
break_valuesThe size and number of service areas to generate for each facility.break_values=5 10 15
travel_modeThe mode of transportation such as driving a car or a truck or walking.travel_mode=JSON Object
travel_directionThe direction of travel (away from facility or towards facility) that should be used when generating service areas.travel_direction=Away From Facility
time_of_dayThe time to depart from or arrive at facilities.time_of_day=1608022800000

Additional parameters: Exercise fine-grained control on how the service area polygons are generated by specifying polygon_detail, polygon_overlap_type, and polygons_for_multiple_facilities parameters.

Code examples

Direct: Find walk distance areas

In this example, use the Service area service to find an area that is within 2.5 kilometers (1.55 miles) of walking distance from an elementary school. Such an area can be used to determine which students are eligible for the school bus service as the students that live within 1.5 miles of walking distance from the school are not eligible.

To find service areas, you need to define one or more facilities around which service areas are generated. The default travelMode is driving time, so in this case the travel mode is set to walking distance. The defaultBreaks are set to 2.5 which is interpreted by the service to be in kilometers since the distance unit of the travel mode's impedance attribute is kilometers. The travel direction is set to esriNATravelDirectionToFacility to calculate the walk area as students walk towards the school.

The response contains a polygon of the walk area with 1.55 miles that does not qualify for bus transportation.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for SwiftArcGIS Maps SDK for KotlinArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt (C++)ArcGIS Maps SDK for Qt (QML)ArcGIS API for PythonArcGIS REST JSEsri LeafletMapLibre GL JSOpenLayersCesiumJS
Expand
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
      async function findServiceArea(locationFeature) {
        if (!travelMode) {
          const networkDescription = await networkService.fetchServiceDescription(url);
          travelMode = networkDescription.supportedTravelModes.find(
            (travelMode) => travelMode.name === "Walking Distance"
          );
        }

        const serviceAreaParameters = new ServiceAreaParameters({
          facilities: new FeatureSet({
            features: [locationFeature]
          }),
          defaultBreaks: [2.5], // km
          travelMode,
          travelDirection: "to-facility",
          outSpatialReference: view.spatialReference,
          trimOuterPolygon: true
        });
        const { serviceAreaPolygons } = await serviceArea.solve(url, serviceAreaParameters);
        showServiceAreas(serviceAreaPolygons);
      }

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
curl https://route-api.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World/solveServiceArea? \
-d "f=json" \
-d "token=<ACCESS_TOKEN>" \
-d "facilities=-117.133163,34.022445" \
-d "defaultBreaks=2.5" \
-d "travelDirection=esriNATravelDirectionToFacility" \
-d "travelMode={'attributeParameterValues':[{'attributeName':'Avoid Private Roads','parameterName':'Restriction Usage','value':'AVOID_MEDIUM'},{'attributeName':'Walking','parameterName':'Restriction Usage','value':'PROHIBITED'},{'attributeName':'Preferred for Pedestrians','parameterName':'Restriction Usage','value':'PREFER_LOW'},{'attributeName':'WalkTime','parameterName':'Walking Speed (km/h)','value':5},{'attributeName':'Avoid Roads Unsuitable for Pedestrians','parameterName':'Restriction Usage','value':'AVOID_HIGH'}],'description':'Follows paths and roads that allow pedestrian traffic and finds solutions that optimize travel distance.','distanceAttributeName':'Kilometers','id':'yFuMFwIYblqKEefX','impedanceAttributeName':'Kilometers','name':'Walking Distance','restrictionAttributeNames':['Avoid Private Roads','Avoid Roads Unsuitable for Pedestrians','Preferred for Pedestrians','Walking'],'simplificationTolerance':2,'simplificationToleranceUnits':'esriMeters','timeAttributeName':'WalkTime','type':'WALK','useHierarchy':false,'uturnAtJunctions':'esriNFSBAllowBacktrack'}"

Job: Find drive-time areas

In this example, you will find the 5, 10, and 15 minute drive-time polygons around all locations of a grocery store chain in a city. The chain wants to use these drive-time areas to see how many customers can easily drive to their stores and thus are more likely to shop there.

The example illustrates how to measure the time it takes potential customers to reach each store. To do so, the travel_direction is set to Towards Facility. Attributes for each store are also provided such as the StoreId, StoreName, and Address. These will be appended to the drive-time areas to correlate the output drive-time area with the store.

APIs

ArcGIS API for Python
Expand
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
    # Connect to the Service area service
    api_key = "YOUR_API_KEY"
    arcgis.GIS("https://www.arcgis.com", api_key=api_key)

    # Call the Service Area service
    result = arcgis.network.analysis.generate_service_areas(facilities=facilities,
                                                            break_values="5 10 15",
                                                            travel_direction="Towards Facility")
    print_result(result)

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.
cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
6
curl https://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas/submitJob? \
-d "f=json" \
-d "token=<ACCESS_TOKEN>" \
-d "facilities={'displayFieldName':'','fieldAliases':{'StoreName':'Store Name','Address':'Address','StoreId':'Store ID'},'geometryType':'esriGeometryPoint','spatialReference':{'wkid':4326,'latestWkid':4326},'fields':[{'name':'StoreName','type':'esriFieldTypeString','alias':'Name','length':50},{'name':'Address','type':'esriFieldTypeString','alias':'Name','length':256},{'name':'StoreId','type':'esriFieldTypeString','alias':'Store ID','length':16}],'features':[{'attributes':{'StoreName':'Store 1','Address':'1775 E Lugonia Ave, Redlands, CA 92374','StoreId':'120'},'geometry':{'x':-117.14002999994386,'y':34.071219999994128}},{'attributes':{'StoreName':'Store 2','Address':'1536 Barton Rd, Redlands, CA 92373','StoreId':'130'},'geometry':{'x':-117.207329999671,'y':34.047980000203609}},{'attributes':{'StoreName':'Store 3','Address':'11 E Colton Ave, Redlands, CA 92374','StoreId':'121'},'geometry':{'x':-117.18194000041973,'y':34.06351999976232}}]}" \
-d "break_values=5 10 15" \
-d "travel_direction='Towards Facility'"
Response (JSON)
Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "jdb99eec215ab41a9961a2563d7933956",
  "jobStatus": "esriJobSubmitted"
}

Tutorials

Services

Routing service

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

API support

RoutingOptimized RoutingFleet routingClosest facility routingService areasLocation-allocationTravel cost matrix
ArcGIS Maps SDK for JavaScript111
ArcGIS Maps SDK for .NET111
ArcGIS Maps SDK for Kotlin111
ArcGIS Maps SDK for Swift111
ArcGIS Maps SDK for Java111
ArcGIS Maps SDK for Qt111
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet2222222
MapLibre GL JS2222222
OpenLayers2222222
Full supportPartial supportNo support
  • 1. Access with geoprocessing task.
  • 2. Access via ArcGIS REST JS.

Tools

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