require(["esri/geometry/operators/cutOperator"], (cutOperator) => { /* code goes here */ });
import * as cutOperator from "@arcgis/core/geometry/operators/cutOperator.js";
esri/geometry/operators/cutOperator
Cut 2D geometries with a polyline.
For polylines, all left cuts will be grouped together in the first geometry, right cuts and coincident cuts are grouped in the second geometry, and each undefined cut, along with any uncut parts, are output as separate polylines.
For polygons, all left cuts are grouped in the first polygon, all right cuts are in the second polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate polygon. If there were no cuts then no geometry will be returned. If the left or right cut does not exist, the returned geometry will be empty for this type of cut. An undefined cut will only be produced if a left cut or right cut was produced, and there was a part left over after cutting or a cut is bounded to the left and right of the polyline that is used to cut.
Property Overview
Name | Type | Summary | Object |
---|---|---|---|
Indicates if the operator supports input geometries that contain curves. | cutOperator |
Property Details
-
supportsCurves
supportsCurves Booleanreadonly
-
Indicates if the operator supports input geometries that contain curves.
- Default Value:true
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Performs the cut operation on a geometry. | cutOperator |
Method Details
-
execute
execute(geometry, polyline){GeometryUnion[]}
-
Performs the cut operation on a geometry.
Parametersgeometry GeometryUnionThe input geometry to be cut.
polyline PolylineThe polyline that will be used to divide the input
geometry
into pieces where they cross thepolyline
.ReturnsType Description GeometryUnion[] Returns an array of geometries created by cutting the input geometry with the polyline
.Example// Cut a polygon with a polyline const cutGeometries = cutOperator.execute(polygon, polyline);