intersectionOrNull

fun intersectionOrNull(geometry1: Geometry, geometry2: Geometry): Geometry?

Calculates the intersection of two geometries. 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 GeometryEngine.tryIntersections(Geometry, Geometry).

Returns an empty geometry if the two input geometries do not intersect.

Supports true curves.

Return

A geometry object that represents the intersection of the given geometries.

Since

200.1.0

See also