require(["esri/geometry/operators/offsetOperator"], (offsetOperator) => { /* code goes here */ });
import * as offsetOperator from "@arcgis/core/geometry/operators/offsetOperator.js";
esri/geometry/operators/offsetOperator
Offset 2D geometries. The offset operation creates a geometry that is a constant distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. If offset distance is greater than 0, then the offset geometry is constructed to the right of the oriented input geometry, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counterclockwise. So the right side of a simple polygon is always its inside. The miter limit is multiplied by the offset distance and the result determines how far a mitered offset intersection can be from the input curve before it is beveled.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Creates an offset version of the input geometry. | offsetOperator | ||
Creates offset versions of the input geometries. | offsetOperator |
Method Details
-
execute
execute(geometry, distance, options){Geometry}
-
Creates an offset version of the input geometry. This is not applicable to point geometries.
ParametersSpecificationgeometry GeometryThe input geometry. Can be an extent, polyline, or polygon. Point and multipoint geometries are not supported.
distance NumberThe distance to offset the input geometry. Unless the
unit
option is set, the default is the geometry's spatial reference unit.options ObjectoptionalAdditional options.
SpecificationflattenError NumberoptionalDefault Value: 0The maximum distance of the resulting segments compared to the true circular arc (used only when
joins
is set to"round"
). The algorithm never produces more than around 180 vertices for each round join.joins StringoptionalDefault Value: "round"Defines the join type of the offset geometry.
Possible Values:"round"|"miter"|"bevel"|"square"
miterLimit NumberoptionalDefault Value: 10Defines when miter joins are replaced with bevel joins.
unit LengthUnitoptionalThe length unit of the offset distance. An error will be thrown if this is set for Geographic Coordinate Systems.
ReturnsType Description Geometry Returns the offset geometry. Example// Create an offset polygon. const offsetPolygon = offsetOperator.execute(polygon, 100);
-
Creates offset versions of the input geometries.
ParametersSpecificationThe set of input geometries. Can be extents, polylines, or polygons. Point and multipoint geometries are not supported.
distance NumberThe distance to offset the input geometries. Unless the
unit
option is set, the default is the geometries spatial reference unit.options ObjectoptionalAdditional options.
SpecificationflattenError NumberoptionalDefault Value: 0The maximum distance of the resulting segments compared to the true circular arc (used only when joins is round). The algorithm never produces more than around 180 vertices for each round join.
joins StringoptionalDefault Value: "round"Defines the join type of the offset geometry.
Possible Values:"round"|"miter"|"bevel"|"square"
miterLimit NumberoptionalDefault Value: 10Defines when miter joins are replaced with bevel joins.
unit LengthUnitoptionalThe length unit of the offset distance. An error will be thrown if this is set for Geographic Coordinate Systems.
Returns