distanceOrNull

fun distanceOrNull(geometry1: Geometry, geometry2: Geometry): Double?

Calculates the simple planar (Euclidean) distance between two geometries. This planar measurement uses 2D Cartesian mathematics to compute the distance. It is based upon the SpatialReference of the input geometries. If the input geometries do not use an 'distance preserving' spatial reference, the result can be inaccurate. You have two options available to calculate a more accurate result:

Return

The distance between the two geometries in the same units as the geometry's spatial reference. Returns null in the following circumstances: geometry1 and geometry2 do not have equivalent spatial references; the types of the input geometries are incompatible (true curve geometries can only be used if the other input Geometry is of type Point).

Since

200.1.0

Parameters

geometry1

A geometry object.

geometry2

Another geometry object.