require(["esri/geometry/operators/symmetricDifferenceOperator"], (symmetricDifferenceOperator) => { /* code goes here */ });
import * as symmetricDifferenceOperator from "@arcgis/core/geometry/operators/symmetricDifferenceOperator.js";
esri/geometry/operators/symmetricDifferenceOperator
Returns the symmetric difference between 2D geometries, also known as exclusive OR, or XOR. The symmetric difference is the union of the geometries minus the intersection.
This operation can be performed only on geometries that have same dimension (e.g. points with points, lines with lines, polygons with polygons or envelopes, etc). Otherwise, the output will be the input geometry of the higher topological dimension.
- See also
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Performs the symmetric difference (XOR) operation on two geometries. | symmetricDifferenceOperator | ||
Performs the symmetric difference (XOR) operation on every geometry in | symmetricDifferenceOperator |
Method Details
-
execute
execute(leftGeometry, rightGeometry){Geometry}
-
Performs the symmetric difference (XOR) operation on two geometries.
ParametersReturnsType Description Geometry Returns the symmetric difference of the two geometries. The result has the higher of dimensions of the two geometries. Example// Calculate the symmetric difference of two polygons. const differencePolygon = symmetricDifferenceOperator.execute(polygon1, polygon2);
-
Performs the symmetric difference (XOR) operation on every geometry in
inputGeometries
withrightGeometry
.ParametersReturns