Buffer

URL:
https://<root>/Utilities/Geometry/GeometryServer/buffer
Methods:
GET
Version Introduced:
9.3

Description

The buffer operation is performed on a geometry service resource. The result of this operation is buffered polygons at the specified distances for the input geometry array. Options are available to union buffers and to use geodesic distance. This operation calls simplify on the input geometries. You can provide arguments to the buffer operation as query parameters defined in the following parameters table.

Request parameters

ParameterDetails

geometries

Specifies 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 the same as the structure of the JSON geometry objects returned by ArcGIS REST API.

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

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

Example:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "geometryType" : "esriGeometryPoint",
  "geometries" :
  [
    {"x" : -104.5, "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

Specifies the well-known ID (WKID) of the spatial reference or a spatial reference JSON object for the input geometries. For a list of valid WKID values, see Using spatial references.

outSR

(Optional)

Specifies the WKID of the spatial reference or a spatial reference JSON object for the returned geometries. For a list of valid WKID values, see Using spatial references.

If outSR is not specified, the output geometries are in the spatial reference specified by bufferSR. If neither outSR nor bufferSR is specified, the output geometries are in the spatial reference specified by inSR.

bufferSR

(Optional)

Specifies the WKID of the spatial reference or a spatial reference JSON object in which the geometries are buffered. For a list of valid WKID values, see Using spatial references.

If bufferSR is not specified, the geometries are buffered in the spatial reference specified by outSR. If neither bufferSR nor outSR is specified, the geometries are buffered in the spatial reference specified by inSR.

distances

Specifies the distances that each of the input geometries is buffered. The distance units are specified by unit .

Syntax

Use dark colors for code blocksCopy
1
distances=<distance1>, <distance2>, ..., <distanceN>

Example

Use dark colors for code blocksCopy
1
distances=100, 123.45

unit

(Optional)

Specifies 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

(Optional)

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

(Optional)

Set geodesic to true to buffer the input geometries using geodesic distance. Geodesic distance is the shortest path between two points along the ellipsoid of the earth. If geodesic is set to false, the 2D Euclidean distance is used to buffer the input geometries. The default value depends on the geometry type, unit, and bufferSR.

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for buffer demonstrating that the point [-117, 34] is buffered in WGS84 (4326) at a distance of 1,000 meters. The geometry is buffered using the Web Mercator projection (3857), and the output polygon is returned in WGS84 (4326).

Use dark colors for code blocksCopy
1
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/buffer?geometries=-117,34&inSR=4326&outSR=4326&bufferSR=3857&distances=1000&f=pjson

The following is a sample request URL for buffer demonstrating two polygons that are each buffered in NAD 1983 (4269) by geodesic distances of 10 miles and 50 miles.

Use dark colors for code blocksCopy
1
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer/buffer?geometries={"geometryType":"esriGeometryPolyline","geometries":[{"paths":[[[0,0],[0,10]]]},{"paths":[[[20,20],[40,40]]]}]}&inSR=4269&distances=10,50&unit=9035&unionResults=false&geodesic=true&f=pjson

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
{
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

JSON Response example

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
{
  "geometries": [
    {
      "rings": [
        [
          [
            0.0063060740000651094,
            -0.14540592099996275
          ],
          [
            5.6843418860808015e-014,
            -0.14554444699996338
          ],
          [
            0.0063060740000651094,
            -0.14540592099996275
          ]
        ]
      ]
    },
    {
      "rings": [
        [
          [
            20.006702008000047,
            19.854763529000024
          ],
          [
            20.000000000000057,
            19.854625290000058
          ],
          [
            20.006702008000047,
            19.854763529000024
          ]
        ]
      ]
    },
    {
      "rings": [
        [
          [
            0.015769745000056901,
            -0.72754867099996545
          ],
          [
            5.6843418860808015e-014,
            -0.72772185799993849
          ],
          [
            0.015769745000056901,
            -0.72754867099996545
          ]
        ]
      ]
    },
    {
      "rings": [
        [
          [
            20.016698604000055,
            19.273275119000061
          ],
          [
            20.000000000000057,
            19.273102911000024
          ],
          [
            20.016698604000055,
            19.273275119000061
          ]
        ]
      ]
    }
  ]
}

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