Constructs the set-theoretic difference between two geometries.
public static Geometry Difference(Geometry geometry1, Geometry geometry2)
is the Geometry instance on the left hand side of the subtraction.
is the Geometry on the right hand side being subtracted.
Returns the result of subtraction. The result has the dimension of the
The GeometryEngine.Difference method performs a spatial subtraction from the two input geometries. This means that the order of the two input geometry
arguments of the GeometryEngine.Difference Static Method will have different results if they are switched. In a theoretical variable format
you can think of the GeometryEngine.Difference equation like:
A (Difference) B = C
B (Difference) A = D
If you were looking for the "complete" difference between two geometries you will need to run the GeometryEngine.Difference
twice by switching the order of the input arguments and then add the two resultant geometries together (most likely via the
Static Method). This "complete" difference
means that you would be interested in obtaining those parts of the two input geometries that have nothing in common. In a theoretical
variable format to get the "complete" different between two geometries you can think of the GeometryEngine.Difference equation like:
[A (Difference) B] + [B (Difference) A] = Complete Difference
The following is a visual illustration of two polygon geometries and how the output result would be from the GeometryEngine.Difference operation:
Supports true curves.
Platforms and versions
|.NET Standard 2.0||100.3 - 100.14|
|.NET 6.0||100.13 - 100.14|
|.NET 6.0 Windows||100.13 - 100.14|
|.NET Framework||100.0 - 100.14|
|.NET 5||100.10 - 100.12|
|.NET Core 3.1||100.7 - 100.12|
|Xamarin.Android||100.0 - 100.14|
|Xamarin.iOS||100.0 - 100.14|
|UWP||100.0 - 100.14|