Skip To Content

Create Buffers

Description

Create Buffers

Buffers—an area that covers a given distance from a point, line, or area feature—are typically used to create areas that can be further analysed using other tools, such as AggregatePoints. For example, if asking the question, "What buildings are within one mile of the school?" the answer can be found by creating a one-mile buffer around the school and overlaying the buffer with the layer containing building footprints. The end result is a layer of those buildings within one mile of the school.

Request parameters

ParameterDetails
inputLayer

(Required)

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

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

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

REST Example

//REST web example
{"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"

//REST scripting example
"inputLayer": {"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}
distance

(Required if field is not provided)

A double value used to buffer the input features. You can only enter a single distance value. The units for distance are supplied by the distanceUnit parameter. You must supply a value for either the distance or field parameters.

REST Examples

//REST web example
4

//REST scripting example
"distance": 105.4
distanceUnit

(Required if field is not provided)

The linear unit to be used with the value specified in distance. The default is Meters.

Values: Meters | Kilometers | Feet | FeetInt | FeetUS | Miles | MilesInt | MilesUS | NauticalMiles | NauticalMilesInt | NauticalMilesUS | Yards | YardsInt | YardsUS

REST Examples

//REST web example
Kilometers

//REST scripting example
"distanceUnit": "Miles"
field

(Required if distance not provided)

A field on the inputLayer containing a buffer distance or a field expression. A buffer expression must begin with an equal sign (=). To learn more about buffer expressions, see Buffer Expressions.

REST Examples

//REST web example
= $feature["Setback"] * 3 + $feature["TreeCoverage"]

//REST scripting example
"bufferField": "= $feature["Setback"] * 3 + $feature["TreeCoverage"]"
method

(Required)

The method used to apply the buffer with. There are two methods to choose from:

  • Planar—Applies a Euclidean buffer and is appropriate for local analysis on projected data. This is the default.
  • Geodesic—Is appropriate for large areas and any geographic coordinate system.

REST Examples

//REST web example
Geodesic

//REST scripting example
"method": "Planar"
dissolveOption

(Optional)

Determines how output polygon attributes are processed. The following values are available:

  • All—All features are dissolved into one feature. You can calculate summary statistics and determine if you want multipart or single part features.
  • List—Features with the same value in the specified field will be dissolved together. You can calculate summary statistics and determine if you want multipart or single part features.
  • None—No features are dissolved. This is the default.

REST Examples

//REST web example
"List"

//REST scripting example
"dissolveOption": "All"
dissolveFields

(Required if dissolveOption is List)

Specifies the fields to dissolve on. Multiple fields may be provided.

REST Examples

//REST web example
Setback, Tree Coverage

//REST scripting example
"dissolveFields": "Setback, Tree Coverage"
summaryFields

(Optional)

A list of field names and statistical summary types that you want to calculate for resulting polygons. Summary statistics are only available if dissolveOption is set to List or All. By default, all statistics are returned.

onStatisticField specifies the name of the fields in the target layer. statisticType can be specified as one of the following:

  • Count—For numeric fields, this totals the number of values of all the points in each polygon. For string fields, this totals the number of strings for all the points in each polygon.
  • Sum—Adds the total value of all the points in each polygon. For numeric fields.
  • Mean—Calculates the average of all the points in each polygon. For numeric fields.
  • Min—Finds the smallest value of all the points in each polygon. For numeric fields.
  • Max—Finds the largest value of all the points in each polygon. For numeric fields.
  • Range—Finds the difference between the Min and Max values. For numeric fields.
  • Stddev—Finds the standard deviation of all the points in each polygon. For numeric fields.
  • Var—Finds the variance of all the points in each polygon. For numeric fields.
  • Any—Returns a sample string of a point in each polygon. For string fields.

REST Examples

//REST web example
[{"statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]

//REST scripting example
"summaryFields": [{"statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]

multipart

(Required if dissolveOption is provided)

A Boolean that determines if output features are multipart or single part. The parameter is set as false by default, denoting that output features are single part. This option is only available if a dissolveOption is applied.

Values: true | false

REST Examples

//REST web example
false

//REST scripting example
"multipart": false
outputName

(Required)

The task will create a feature service of the results. You define the name of the service.

REST Examples

//REST web example
myOutput

//REST scripting example
"outputName": "myOutput"
context

(Optional)

The context parameter contains additional settings that affect task execution. For this task, there are four settings:

  • Extent (extent)—A bounding box that defines the analysis area. Only those features that intersect the bounding box will be analyzed.
  • Processing spatial reference (processSR)—The features will be projected into this coordinate system for analysis.
  • Output spatial reference (outSR)—The features will be projected into this coordinate system after the analysis to be saved. The output spatial reference for the spatiotemporal big data store is always WGS84.
  • Data store (dataStore)—Results will be saved to the specified data store. The default is the spatiotemporal big data store.

Syntax:
{
"extent" : {extent},
"processSR" : {spatial reference},
"outSR" : {spatial reference},
"dataStore":{data store}
}

f

The response format. The default response format is html.

Values: html | json

Example usage

Below is a sample request URL for CreateBuffers:

https://webadaptor.domain.com/server/rest/services/System/GeoAnalyticsTools/GPServer/CreateBuffers/submitJob?inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&distance=4&distanceUnit=Meters&field== $feature["Setback"]&method=Planar&dissolveOption="All"&summaryFields=[{"statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]&multipart=false&outputName=myOutput&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}}&f=json

Response

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

Syntax:
{
"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:

https://<analysis url>/CreateBuffers/jobs/<jobId>

Access 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:

https://<analysis-url>/CreateBuffers/jobs/<jobId>/results/output?token=<your token>&f=json

ResponseDescription
output

output returns the buffered features as polygons. Is a summaryFields parameter is specified in the task request, the layer will compute the Count statistics, as well as anything in the summaryFields. These statistics are only calculated on the dissolved fields.

{"url": "https://<analysis-url>/CreateBuffers/jobs/<jobId>/results/output"}

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

{
"paramName":"output", 
"dataType":"GPRecordSet",
"value":{"url":"<hosted featureservice layer url>"}
}

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