CreateBuffers

The CreateBuffers task creates an area that extends a specified distance around each input point, line, or polygon feature. Buffers are typically used to create areas that can be further analyzed using a task such as OverlayLayers.

For example, if the question is "What buildings are within one mile of the school?", the answer can be determined by creating a one-mile buffer around the school and overlaying the buffer with the layer containing building footprints. The result is a layer of those buildings within one mile of the school.

Request URL

Use dark colors for code blocksCopy
1
https://<analysis url>CreateBuffers/submitJob

Request parameters

NameRequiredTypeDefaultDescription
inputLayer Required featureThe point, line, or polygon features to be buffered.
distances Sometimes required doubleThe buffer distance values.
field Sometimes required stringThe field containing buffer distances.
units Optional stringMetersThe units for the buffer distances.
dissolveType Optional stringNoneSpecifies how overlapping buffers are processed.
ringType Optional stringSpecifies how multiple-distance buffers are processed.
sideType Optional stringSpecifies the side of the line that will be buffered when buffering line features, or whether the input polygon is included or excluded when buffering polygon features.
endType Optional stringThe shape of the buffer at the end of line input features.
outputName Optional stringThe name of the output feature service.
context Optional stringThe extent and output spatial reference environments.
f Optional stringhtmlThe response format.

required Required sometimes required Sometimes required optional Optional

inputLayer

feature | required

The point, line, or polygon features to be buffered.

Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:

  • A URL to a feature service layer with an optional filter to select specific features
  • A feature collection

Examples:

  • {"url": <feature service layer url>, "filter": <where clause>}
  • {"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

distances

double | sometimes required

An array of double values used to buffer the input features. You can enter a single distance value or multiple values, separating each value with a comma.

You must supply values for either the distances or field parameter. Use distances to create buffers with uniform distances for all features.

Examples:

  • "distances": [4.0]
  • "distances": [4.0, 5.0, 6.0]

field

string | sometimes required

A field from inputLayer containing a buffer distance. Multiple distance values per feature are not supported using this method.

You must supply values for either the distances or field parameter. Use field to create buffers that vary distance between features.

Example: "field": "Setback"

units

string | optional

Default value: Miles or Kilometers

Accepted values: Meters | Kilometers | Feet | Miles | NauticalMiles | Yards

The linear unit to be used with the distance values specified in distances or contained in the field value. The default value depends on whether your user profile is configured for U.S. standard or metric units.

Example: "units": "Feet"

dissolveType

string | optional

Default value: None

Accepted values: None | Dissolve

Specifies how overlapping buffers are processed in the output.

The following options are available:

  • None—Overlapping areas are kept.
  • Dissolve—Overlapping areas are combined.
None Dissolve

Example: "dissolveType": "Dissolve"

ringType

string | optional

Default value: Disks

Accepted values: Disks | Rings

Specifies how multiple-distance buffers are processed.

Specifies whether the outer buffers should include the areas within the smaller buffers when multiple values are provided in the distances parameter.

The following options are available:

  • Disks—Larger buffers include areas within one or more smaller buffers. For example, if the distances are 10 and 14, the result will be two buffers, one from 0 to 10 and one from 0 to 14.
  • Rings—Larger buffers do not include areas within one or more smaller buffers. For example, if the distances are 10 and 14, the result will be two buffers, one from 0 to 10 and one from 10 to 14.
Disks Rings

Example: "ringType": "Disks"

sideType

string | optional

The functionality and accepted values for sideType depend on whether the input features are lines or polygons.

sideType is only used for single distance buffers.

Lines

Default value: Full

Accepted values: Full | Right | Left

Specifies the side of the line that will be buffered. In most cases, the buffer should apply to both sides of the line (Full).

The left and right side of the line is determined based on the direction of the line from its start coordinate to its end coordinate and may not represent the same side of the line when displayed spatially. Specifying left or right usually means you know that the line features were created and stored in a particular direction (for example, upstream or downstream in a river network).

The following options are available for line features:

  • Full—Both sides of the line will be buffered.
  • Right—Only the right side of the line will be buffered.
  • Left—Only the left side of the line will be buffered.
Full Right Left

Example: "sideType": "Right"

Polygons

Default value: No value

Accepted values: No value | Outside

Specify whether the buffer includes or excludes the polygon being buffered.

The following options are available for polygon features:

  • No value—The polygon being buffered is included in the result buffer.
  • Outside—The polygon being buffered is excluded in the result buffer.
No value Outside

Example: "sideType": "Outside"

endType

string | optional

Default value: Round

Accepted values: Round | Flat

The shape of the buffer at the end of line input features. At the ends of lines, the buffer can be rounded (Round) or be straight across (Flat).

This parameter is not valid for point or polygon input features and is only used for single distance buffers.

The following options are available:

  • Round—Buffers will be rounded at the ends of lines.
  • Flat—Buffers will be flat at the ends of lines.
Round Flat

Example: "endType": "Flat"

outputName

string | optional

The name of the output layer.

If provided, the task will create a feature service of the results. You define the name of the service. If an outputName value is not provided, the task will return a feature collection.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "serviceProperties": {
		"name": "featureServiceName"
  }
}

You can overwrite an existing feature service by providing the itemId, serviceURL, or name value of the existing feature service and setting the overwrite property to true. Including the serviceProperties parameter is optional. As described in the Feature output topic, you must either be the owner of the feature service or have administrative privileges to perform the overwrite.

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "itemProperties": {
		"itemId": "52d34e7598e7484188228xxxxxx",
		"overwrite": true
  }
}

context

string | optional

The Context parameter contains the following additional settings that affect task operation:

  • Extent (extent)—A bounding box that defines the analysis area. Only input features that intersect the bounding box will be analyzed.
  • Output spatial reference (outSR)—The output features will be projected into the output spatial reference.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
"extent" : {extent},
"outSR" : {spatial reference}
}

f

string | optional

Default value: html

Accepted values: html | json

The response format.

Response

When you submit a request, the service assigns a unique job ID for the transaction.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "<unique job identifier>",
  "jobStatus": "<job status>"
}

After the initial request is submitted you can use jobId to periodically check the status of the job and messages as described in Check job status. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request of the following form:

Use dark colors for code blocksCopy
1
https://<analysis url>/CreateBuffers/jobs/<jobId>

Accessing results

When the status of the job request is esriJobSucceeded, you can access the results of the analysis by making a request of the following form:

Use dark colors for code blocksCopy
1
https://<analysis url>/CreateBuffers/jobs/<jobId>/results/bufferLayer?token=<your token>&f=json

bufferLayer

features | required

The buffer polygons.

Fields

Depending on the tool configurations, the following fields may be included in bufferLayer:

  • All fields from inputLayer.

  • Buffer Distance in [Unit] (BUFF_DIST)—A double value based on distances. This field is not included when field is used for the buffer distance.

  • ORIG_FID—The unique ID for the input feature.

  • Areas in Square Miles or Area in Square Kilometers (AnalysisArea)—The total area of the buffered feature. The unit in this field is based on whether the value for units is imperial or metric.

The included fields depend on the dissolveType setting and whether the buffer distance is configured using the distances or field parameter.

The following output fields are included when dissolveType is None:

Field namedistances parameterfield parameter
inputLayers fields Included Included
BUFF_DIST Included Not included
ORIG_FID Included Included
AnalysisArea Included Included

required Included optional Not included

Request example
Use dark colors for code blocksCopy
1
{"url":"https://<analysis url>/CreateBuffers/jobs/<jobId>/results/bufferLayer"}

The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter value provided in the initial request.

If outputName is provided, value contains the URL to the feature service layer as follows:

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "paramName":"bufferLayer",
  "dataType":"GPString",
  "value":{"url":"<hosted feature service layer url>"}
}

See Feature output for more information about how the result layer or collection is accessed.

Licensing

This task requires the following user type and configurations:

  • Creator, Professional, or Professional Plus user type
  • Publisher or Administrator role, or an equivalent custom role

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