import { bufferExecute, execute, bufferExecuteMany, executeMany, bufferSupportsCurves } from "@arcgis/core/geometry/operators/bufferOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Creates planar buffers around 2D geometries. A planar buffer calculates the area around a geometry using the straight line distance between points based on a flat, two-dimensional surface. This is suitable for rendering smaller areas within a projected coordinate system where the curvature of the Earth can be ignored, such as when all features are contained in one UTM zone. Planar buffers can introduce distortions and inaccuracies when applied over larger areas.

Buffer operator

See also

Type definitions

BufferExecuteOptions

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

unit

Property
Type
LengthUnit | undefined

The length unit of the buffer distances and max deviation. The default is the input geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.

ExecuteOptions

deprecated Type definition

BufferExecuteManyOptions

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

maxDeviation

Property
Type
number | undefined

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 spatial reference unit of geometries.

Default value
NaN

maxVerticesInFullCircle

Property
Type
number | undefined

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

Default value
96

union

Property
Type
boolean | undefined

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

Default value
false

ExecuteManyOptions

deprecated Type definition

Functions

bufferExecute

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Creates a buffer around the input geometry.

Signature
bufferExecute (geometry: GeometryUnion, distance: number, options?: BufferExecuteOptions): Polygon | null | undefined

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry to be buffered.

distance

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

options

Additional options.

Returns
Polygon | null | undefined

Returns the buffered geometry or null.

Example
// Buffer a polyline geometry
const bufferGeometry = bufferExecute(polyline, 1000);

execute

deprecated Function

Creates a buffer around the input geometry.

Signature
execute (geometry: GeometryUnion, distance: number, options?: BufferExecuteOptions): Polygon | null | undefined

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry to be buffered.

distance

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

options

Additional options.

Returns
Polygon | null | undefined

Returns the buffered geometry or null.

Example
// Buffer a polyline geometry
const bufferGeometry = bufferExecute(polyline, 1000);

bufferExecuteMany

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

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.

Signature
bufferExecuteMany (geometries: GeometryUnion[], distances: number[], options?: BufferExecuteManyOptions): Polygon[]

Parameters

ParameterTypeDescriptionRequired
geometries

The input geometries to be buffered. All the geometries must have the same spatial reference.

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 spatial reference unit of geometries.

options

Additional options.

Returns
Polygon[]

Returns the buffered geometries.

executeMany

deprecated Function

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.

Signature
executeMany (geometries: GeometryUnion[], distances: number[], options?: BufferExecuteManyOptions): Polygon[]

Parameters

ParameterTypeDescriptionRequired
geometries

The input geometries to be buffered. All the geometries must have the same spatial reference.

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 spatial reference unit of geometries.

options

Additional options.

Returns
Polygon[]

Returns the buffered geometries.

Variables

bufferSupportsCurves

Variable
Since
ArcGIS Maps SDK for JavaScript 5.2

Indicates if the operator supports input geometries that contain curves. The value will always be true. This will produce densified output geometries.

Type
boolean

supportsCurves

deprecated Variable

Indicates if the operator supports input geometries that contain curves. The value will always be true. This will produce densified output geometries.

Type
ReturnType