Skip to content
import { isLoaded, load, execute, executeMany, supportsCurves } from "@arcgis/core/geometry/operators/geodesicBufferOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Geodesically buffer 2D geometries. A geodesic buffer creates an area around a geometry by calculating the shortest distance between points on the curved surface of the Earth, minimizing the distortion caused by map projections. This results in a more accurate buffer when applied over larger geographic areas such as those covering multiple UTM zones, or when using global scales.

Notes

Verify that isLoaded() returns true before using this module. Use load() to load this module's dependencies.

See also

Type definitions

ExecuteOptions

Type definition

curveType

Property
Type
GeodeticCurveType | undefined

The type of geodetic curve used to determine the buffer.

Default value
"geodesic"

maxDeviation

Property
Type
number | undefined

The deviation offset to use for convergence. Unless the unit option is set, the default is meters. The geodesic arcs of the resulting buffer will be closer than the max deviation of the true buffer. The default value of NaN will be a maximum of 0.01 meters and (up-to) 0.2% of the buffer distance.

Default value
NaN

unit

Property
Type
LengthUnit | undefined

The length unit of the buffer distances and max deviation.

Default value
"meters"

ExecuteManyOptions

Type definition
Supertypes
ExecuteOptions

union

Property
Type
boolean | undefined

If true, the resulting buffer geometries will be unioned.

Default value
false

Functions

isLoaded

Function

Indicates if all dependencies of this module have been loaded.

Signature
isLoaded (): boolean
Returns
boolean

Returns true if this module's dependencies have been loaded.

load

Function

Loads this module's dependencies. This method must be called first if isLoaded returns false.

See also
Signature
load (): Promise<void>
Returns
Promise<void>

Resolves when the dependencies have been loaded.

execute

Function

Creates a geodesic buffer around the input geometry.

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

The geometry to buffer.

distance

The buffer distance for the geometry. Unless the unit option is set, the default is meters.

options

Additional options.

Returns
Polygon | null | undefined

Returns the buffered geometry or null.

Example
if (!geodesicBufferOperator.isLoaded()) {
await geodesicBufferOperator.load();
}
// Calculate the buffer of a polyline geometry
const bufferGeometry = geodesicBufferOperator.execute(polyline, 100);

executeMany

Function

Creates a geodesic buffer around the input geometries.

Signature
executeMany (geometries: GeometryUnion[], distances: number[], options?: ExecuteManyOptions): Polygon[]
Parameters
ParameterTypeDescriptionRequired
geometries

The set of geometries to buffer. All the geometries must have the same spatial reference.

distances
number[]

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

options

Additional options.

Returns
Polygon[]

Returns the buffered geometries.

Variables

supportsCurves

Variable

Indicates if the operator supports input geometries that contain curves. The value is null or undefined until the operator is loaded, then it will always be true. This will produce densified output geometries.

Type
boolean | null | undefined