Show / Hide Table of Contents

Method Intersection

Intersection(Geometry, Geometry)

Calculates the intersection of two geometries.

Declaration
public static Geometry Intersection(this Geometry geometry1, Geometry geometry2)
Parameters
Type Name Description
Geometry geometry1

The first geometry.

Geometry geometry2

The second geometry of dimension equal to or greater than the elements of the first geometry.

Returns
Type Description
Geometry

A geometry that represents the intersection of the two input geometries.

Remarks

GeometryEngine.Intersection returns those parts of the two input geometries that have things in common. This means that the order of the input parameters of the GeometryEngine.Intersection is irrelevant. In a theoretical variable format you can think of the GeometryEngine.Intersection equation like:
A (Intersection) B = C
B (Intersection) A = C

The following is a visual illustration of two polygon geometries and how the output result would be from the GeometryEngine.Intersection operation:

GeometryEngine.Intersection visual examples.

The result has the same dimensionality as the lower dimensionality of the two intersecting geometries. If there is no intersection with this dimensionality, returns an empty geometry. For example, the intersection of two polygons (geometries with area, so they have dimensionality of 2) or, say, a polygon and an envelope (also an area) is a polygon. Similarly, the intersection of a polyline (a line, so dimensionality of 1) and another polyline is always a polyline. Therefore when computing the intersection of polylines, this function does not return points where they cross, but rather lines of overlap. If there are no lines of overlap, an empty polyline is returned even if the input lines cross. To obtain all intersections, irrespective of dimensionality, see Intersections(Geometry, Geometry). Returns an empty geometry if the two input geometries do not intersect.

Supports true curves.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7
In This Article
Back to top Copyright © 2022 Esri.