bufferOperator

AMD: require(["esri/geometry/operators/bufferOperator"], (bufferOperator) => { /* code goes here */ });
ESM: import * as bufferOperator from "@arcgis/core/geometry/operators/bufferOperator.js";
Object: esri/geometry/operators/bufferOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
beta

Creates planar buffers around 2D geometries.

Method Overview

Name Return Type Summary Object

Creates a buffer around the input geometry.

bufferOperator

Creates a buffer around the input geometries.

bufferOperator

Method Details

execute

Method
execute(geometry, distance, options){Geometry |null}

Creates a buffer around the input geometry.

Parameters
geometry Geometry

The input geometry to be buffered.

distance Number

The buffer distance for the geometry. Unless the unit option is set, the default is the geometry's spatial reference unit.

options Object
optional

Additional options.

Specification
unit LengthUnit
optional

The length unit of the buffer distance. An error will be thrown if this is set for Geographic Coordinate Systems.

Returns
Type Description
Geometry | null Returns the buffered geometry or null.
Example
// Buffer a polyline geometry
const bufferGeometry = bufferOperator.execute(polyline, 1000);

executeMany

Method
executeMany(geometries, distances, options){Geometry[]}

Creates a buffer around the input geometries.

Both maxDeviation and maxVerticesInFullCircle control the quality of round joins that are in the buffers. The precision of each buffer is maxDeviation unless the number of required vertices is too large.

Parameters
Specification
geometries Geometry[]

The input geometries to be buffered.

distances Number[]

The buffer distances for the geometries. If the size of this array is less than the number of geometries in the input geometries, the last distance value is used for the rest of geometries. Unless the unit option is set, the default is the geometries spatial reference unit.

options Object
optional

Additional options.

Specification
maxDeviation Number
optional
Default Value: NaN

The max deviation of the result buffer from the true buffer. When the value is NaN, internal logic is used to select deviation based on the buffer distance. Unless the unit option is set, the default is the geometries spatial reference unit.

maxVerticesInFullCircle Number
optional
Default Value: 96

The maximum number of vertices in the polygon produced from a buffered point.

union Boolean
optional
Default Value: false

Indicates if the buffer geometries should be unioned. When set to true, the output will be a single geometry.

unit LengthUnit
optional

The length unit of the buffer distances and max deviation. An error will be thrown if this is set for Geographic Coordinate Systems.

Returns
Type Description
Geometry[] Returns the buffered geometries.

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