A buffer analysis resulting in a new layer with 1000 feet areas around high schools.
What is a buffer analysis? A buffer analysis is the process of creating an area at a distance around a point, line, or polygon feature. To execute the analysis, use the spatial analysis service and the Create Buffers
operation.
Real-world examples of this analysis include the following:
Creating a buffer around schools. Creating a buffer around transit lines. Generating a buffer around points of interest. After calculating a buffer area, you can use the resulting polygon for further analysis to answer questions such as: how many points of interest are within a mile of a specific location, or what buildings are within 500 feet of a school?
How to create a buffer The general steps to create a buffer are as follows:
Review the parameters for the Create Buffers
operation. Send a request to get the spatial analysis service URL. Execute a job request with the following URL and parameters: URL: https: //< YOUR_ ANALYSIS_ SERVICE>/arcgis/rest/services/tasks/GPServer/Create Buffers/submit Job
Parameters:input Layer
: Your points dataset as a hosted feature layer or feature collection.distances
or field
: The value containing the buffer distance. Use distances
if you want multiple distances with which to calculate buffers. output Name
: A string representing the name of the hosted feature layer to reutrn with the results. Check the status . Get the output layer results . To see examples using ArcGIS API for Python, ArcGIS REST JS, and the ArcGIS REST API, go to Examples below.
URL request
Use dark colors for code blocks Copy
1
http : //<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/CreateBuffers/submitJob?<parameters>
Required parameters Name Description Examples f
The format of the data returned. f=json
f=pjson
token
An OAuth 2.0 access token . Learn how to get an access token in Security and authentication . token=< ACCESS_ TOKEN>
input Layer
The point, line, or polygon features to be buffered. {"url":"https: //services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Police_ Stations/Feature Server/0","name":"Police Stations"}
distances
If not using field
. The value with which the buffer will be calculated.1
field
If not using distances
. A field within the input Layer
containing a buffer distance.ATTRIBUTE_ FIELD
Key parameters Name Description Examples units
The unit to be used with the specified distance values. Meters
, Kilometers
, Miles
dissolve Type
Determines whether overlapping buffers are split, dissolved, or kept. None
, Dissolve
, Split
output Name
A string representing the name of the hosted feature layer to return with the results. NOTE : If you do not include this parameter, the results are returned as a feature collection (JSON). {"service Properties": {"name": "< SERVICE_ NAME>"}}
context
A bounding box or output spatial reference for the analysis. "extent":{"xmin: ", "ymin: ", "xmax: ", "ymax: "}
Code examples Bike routes (lines) This example uses the Create Buffers
operation to create areas 200 feet around bike routes.
Buffer analysis showing 200 ft areas around bike routes.
APIs ArcGIS API for Python ArcGIS API for Python ArcGIS REST JS
Expand
Use dark colors for code blocks Copy
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
input_layer = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Portland%20Bike%20Routes/FeatureServer/0"
results = create_buffers(
input_layer=input_layer,
dissolve_type= "Dissolve" ,
distances=[ 200 ],
units= "Feet" ,
ring_type= "Rings" ,
context={
"extent" : {
"xmin" : - 13727534.4477 ,
"ymin" : 5604395.5062 ,
"xmax" : - 13547856.7377 ,
"ymax" : 5741928.7477 ,
"spatialReference" : { "wkid" : 102100 },
}
},
#Outputs results as a hosted feature layer.
output_name= "Create buffer results"
)
Service requests 1. Get the analysis service URL 2. Submit job 3. Check job status 4. Get results
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
1
2
3
4
5
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type : application/x-www-form-urlencoded
&f=json
&token= < ACCESS_TOKEN >
Response (JSON)
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
11
{
"helperServices" : {
// Other parameters
"analysis" : {
"url" : "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
},
"geoenrichment" : {
"url" : "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
}
}
}
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
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
POST <YOUR_ANALYSIS_SERVICE> /arcgis/ rest /services/ tasks /GPServer/ CreateBuffers /submitJob HTTP/ 1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
&inputLayer={ "url" : "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Portland Bike Routes/FeatureServer/0" , "name" : "Portland Bike Routes" }
&dissolveType=Dissolve
&distances=[ 200 ]
&units=Feet
&ringType=Rings
&sideType=Full
&endType= Round
&outputName={ "serviceProperties" :{ "name" : "Create buffer results" }}
&context={ "extent" :{ "xmin" :- 13662729.567933429 , "ymin" : 5698255.281363884 , "xmax" :- 13646142.732795566 , "ymax" : 5708813.1458957605 , "spatialReference" :{ "wkid" : 102100 , "latestWkid" : 3857 }}}
Response (JSON)
Use dark colors for code blocks Copy
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
{
"jobId" : "<JOB_ID>" ,
"jobStatus" : "esriJobSubmitted" ,
"results" : {},
"inputs" : {},
"messages" : []
}
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
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
POST <YOUR_ANALYSIS_SERVICE> /arcgis/ rest /services/ tasks /GPServer/ CreateBuffers /jobs/ <JOB_ID> HTTP/ 1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocks Copy
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
// Executing job
{
"jobId" : "<JOB_ID>" ,
"jobStatus" : "esriJobExecuting" ,
"results" : {},
"inputs" : {},
"messages" : []
}
// Job succeeded
{
"jobId" : "<JOB_ID>" ,
"jobStatus" : "esriJobSucceeded" ,
"results" : {
"bufferLayer" : {
"paramUrl" : "results/bufferLayer"
},
},
"inputs" : {},
"messages" : []
}
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
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
POST <YOUR_ANALYSIS_SERVICE> /arcgis/ rest /services/ tasks /GPServer/ CreateBuffers /jobs/ <JOB_ID> /results/ bufferLayer HTTP/ 1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&returnType=data
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocks Copy
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
{
"paramName" : "bufferLayer" ,
"dataType" : "GPString" ,
"value" : {
"url" : "<SERVICE_URL>" ,
"itemId" : "<ITEM_ID>"
}
}
Recreational parcels (polygons) This example uses the Create Buffers
operation to create areas one mile around recreational parcels in the Santa Monica Mountains Parcels hosted feature layer.
Buffer analysis showing 1 mile areas around recreational parcels.
APIs ArcGIS API for Python ArcGIS API for Python ArcGIS REST JS
Expand
Use dark colors for code blocks Copy
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
input_layer = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Santa_Monica_Mountains_Parcels/FeatureServer/0/query?where=UseType='Recreational'"
results = create_buffers(
input_layer=input_layer,
dissolve_type= "Dissolve" ,
distances=[ 1 ],
units= "Miles" ,
ring_type= "Rings" ,
context={
"extent" : {
"xmin" : - 13241162.787695415 ,
"ymin" : 4029393.2145536076 ,
"xmax" : - 13208887.252502043 ,
"ymax" : 4049992.993676435 ,
"spatialReference" : { "wkid" : 102100 },
}
},
#Outputs results as a hosted feature layer.
output_name= "Create buffer results"
)
Service requests 1. Get the analysis service URL 2. Submit job 3. Check job status 4. Get results
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
1
2
3
4
5
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type : application/x-www-form-urlencoded
&f=json
&token= < ACCESS_TOKEN >
Response (JSON)
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
11
{
"helperServices" : {
// Other parameters
"analysis" : {
"url" : "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
},
"geoenrichment" : {
"url" : "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
}
}
}
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
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
POST <YOUR_ANALYSIS_SERVICE> /arcgis/ rest /services/ tasks /GPServer/ CreateBuffers /submitJob HTTP/ 1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
&inputLayer={ "url" : "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Santa_Monica_Mountains_Parcels/FeatureServer/0" , "filter" : "UseType = 'Recreational'" , "name" : "Santa_Monica_Mountains_Parcels" }
&dissolveType=Dissolve
&distances=[ 1 ]
&units=Miles
&ringType=Rings
&sideType=Full
&endType= Round
&outputName={ "serviceProperties" :{ "name" : "Create buffer results" }}
&context={ "extent" :{ "xmin" :- 13241162.787695415 , "ymin" : 4029393.2145536076 , "xmax" :- 13208887.252502043 , "ymax" : 4049992.993676435 , "spatialReference" :{ "wkid" : 102100 , "latestWkid" : 3857 }}}
Response (JSON)
Use dark colors for code blocks Copy
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
{
"jobId" : "<JOB_ID>" ,
"jobStatus" : "esriJobSubmitted" ,
"results" : {},
"inputs" : {},
"messages" : []
}
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
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
POST <YOUR_ANALYSIS_SERVICE> /arcgis/ rest /services/ tasks /GPServer/ CreateBuffers /jobs/ <JOB_ID> HTTP/ 1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocks Copy
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
// Executing job
{
"jobId" : "<JOB_ID>" ,
"jobStatus" : "esriJobExecuting" ,
"results" : {},
"inputs" : {},
"messages" : []
}
// Job succeeded
{
"jobId" : "<JOB_ID>" ,
"jobStatus" : "esriJobSucceeded" ,
"results" : {
"bufferLayer" : {
"paramUrl" : "results/bufferLayer"
},
},
"inputs" : {},
"messages" : []
}
Request HTTP HTTP cURL
Use dark colors for code blocks Copy
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
POST <YOUR_ANALYSIS_SERVICE> /arcgis/ rest /services/ tasks /GPServer/ CreateBuffers /jobs/ <JOB_ID> /results/ bufferLayer HTTP/ 1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&returnType=data
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocks Copy
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
{
"paramName" : "bufferLayer" ,
"dataType" : "GPString" ,
"value" : {
"url" : "<SERVICE_URL>" ,
"itemId" : "<ITEM_ID>"
}
}
Tutorials Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.
Services Process spatial datasets to discover relationships and patterns.
API support Full support Partial support No support