FRAMES | NO FRAMES Description | Parameters | Examples | Response
Buffer Geometries (Operation)
URL http://<geometryservice-url>/buffer
Parent Resource Geometry Service

Description

The buffer operation is performed on a geometry service resource. The result of this operation is buffer polygons at the specified distances for the input geometry array. An option is available to union buffers at each distance.

From 10.1 onwards this operation will call Simplify on the input geometries.

Note that when the bufferSR is GCS:

You can provide arguments to the buffer operation as query parameters defined in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
geometries Description: The array of geometries to be buffered. The spatial reference of the geometries is specified by inSR. The structure of each geometry in the array is same as the structure of the JSON geometry objects returned by the ArcGIS REST API.

Syntax and Examples:

JSON Structures:

Syntax:
{
"geometryType" : "<esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryMultipoint>"
"geometries" : [ <geometry1>, <geometry2> ]
}

The geometries property is an array of input geometries. All geometries in this array should be of the type defined by the geometryType property.

Example:
{
"geometryType" : "esriGeometryPoint",
"geometries" : [
{"x" : -104.53, "y" : 34.74},
{"x" : -63.53, "y" : 10.23}
]
}

Simple Syntax for point geometries:

When using points, in addition to the JSON structures, you can specify the geometries with a simpler comma-separated syntax.

Syntax: geometries=x1, y1, x2, y2, ..., xn, yn
Example: geometries=-104.53, 34.74, -63.53, 10.23

URL based:

For a large set of geometries, you can specify a URL to the input geometries stored in a JSON structure in a file on a public server. The expected format of the file’s contents will be exactly the same as that expected if the geometries were directly embedded in the request.

Syntax: geometries={ "url" : "<URL to file>" }
Example: geometries={ "url" : "http://myserver/mygeometries/afile.txt" }

inSR Description: The well-known ID of the spatial reference or a spatial reference json object for the input geometries. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.
outSR Description: The well-known ID of the spatial reference or a spatial reference json object for the returned geometries. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

If outSR is not specified, the output geometries are in the spatial reference specified by bufferSR. If bufferSR is also not specified, they are in the spatial reference specified by inSR.
bufferSR Description: The well-known ID of the spatial reference or a spatial reference json object in which the geometries are buffered. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

If bufferSR is not specified, the geometries are buffered in the spatial reference specified by outSR. If outSR is also not specified, they are buffered in the spatial reference specified by inSR.
distances Description: The distances the input geometries are buffered. The distance units are specified by unit.

Syntax: distances=<distance1>, <distance2>
Example: distances=100, 123.45
unit Description: The units for calculating each buffer distance. If unit is not specified, the units are derived from bufferSR. If bufferSR is not specified, the units are derived from inSR.

For a list of valid units, see esriSRUnitType Constants and esriSRUnit2Type Constants.
unionResults Description: If true, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. The default is false.

Values: true | false
geodesic Description: If geometries are in geographic coordinate system, then geodesic needs to be set to true in order to generate a buffer polygon using a geodesic distance. bufferSR input parameter will be ignored when geodesic is set to true.

Example Usage

Example 1: In this example, the point [-117, 34] is buffered in WGS 84 (4326) at a distance of 1000 meters. The geometry should be buffered using the Web Mercator projection (102113) and the output polygon should be returned in WGS 84 (4326).

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/buffer?
geometries=-117,34&
inSR=4326&
outSR=4326&
bufferSR=102113&
distances=1000

JSON Response Syntax

{
"geometries" : [
<geometry1>, <geometry2> ]
}

JSON Response Example

{
"geometries" : [
{ "rings" : [ [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832], [-97.06138,32.837] ], [ [-97.06326,32.759], [-97.06298,32.755], [-97.06153,32.749], [-97.06326,32.759] ] ] },
{ "rings" : [ [ [-96.3575,28.423], [-96.3448,28.416], [-96.3399,28.408], [-96.3575,28.423] ] ] }
]
}