require(["esri/geometry/operators/graphicBufferOperator"], (graphicBufferOperator) => { /* code goes here */ });
import * as graphicBufferOperator from "@arcgis/core/geometry/operators/graphicBufferOperator.js";
esri/geometry/operators/graphicBufferOperator
Creates planar buffers around 2D geometries using graphical joins and caps.
Property Overview
Name | Type | Summary | Object |
---|---|---|---|
Indicates if the operator supports input geometries that contain curves. | graphicBufferOperator |
Property Details
-
supportsCurves
supportsCurves Booleanreadonly
-
Indicates if the operator supports input geometries that contain curves. This will produce densified output geometries.
- Default Value:true
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Creates a buffer around the input geometries, using graphical joins and caps. | graphicBufferOperator |
Method Details
-
Creates a buffer around the input geometries, using graphical joins and caps.
Both
maxDeviation
andmaxVerticesInFullCircle
control the quality of round joins that are in the buffers. The precision of each buffer is defined bymaxDeviation
unless the number of required vertices is too large.ParametersSpecificationgeometries GeometryUnion[]The input geometries to be buffered. All the geometries must have the same spatial reference.
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 theunit
option is set, the default is the geometries spatial reference unit.joins StringDefines the buffers shape where geometries are joined.
- Miter joins are replaced with bevel when the ratio of the miter thickness to the buffer distance is greater than miter limit. The miter thickness is the distance from the vertex to the mitered corner of the buffer that this vertex generates.
Possible Values:"round"|"miter"|"bevel"
caps StringDefines the buffers shape at the end points of the geometries.
- Points with square caps will be drawn as squares.
- Open polylines paths with square caps degenerate to a point and will be drawn as squares (degenerate with zero tolerance).
- Open polylines paths with round caps degenerate to a point and will be drawn as circles (degenerate with zero tolerance).
Possible Values:"round"|"butt"|"square"
options ObjectoptionalAdditional options.
SpecificationmaxDeviation NumberoptionalDefault Value: NaNThe max deviation of the result buffer from the true buffer in the geometries spatial reference units. When the value is NaN, internal logic is used to select the deviation based on the buffer distance. Unless the
unit
option is set, the default is the geometries spatial reference unit.maxVerticesInFullCircle NumberoptionalDefault Value: 96The maximum number of vertices in the polygon produced from a buffered point.
miterLimit NumberoptionalDefault Value: 10Defines when miter joins are replaced with bevel joins.
union BooleanoptionalDefault Value: falseIndicates if the buffer geometries should be unioned. When set to
true
, the output will be a single geometry.unit LengthUnitoptionalThe length unit of the buffer distances and max deviation. An error will be thrown if this is set for Geographic Coordinate Systems.
ReturnsExample// Buffer two polylines with different distances and buffer styles. const buffers = graphicBufferOperator.executeMany( [polyline1, polyline2], [1000, 1500], "square", "round", 10, );