Method Distance
Distance(Geometry, Geometry)
Measures the simple Euclidean distance between two geometries. This is a planar measurement using 2D
Cartesian mathematics to calculate the distance in the same coordinate space as the inputs.
Use Distance
Declaration
public static double Distance(this Geometry geometry1, Geometry geometry2)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geometry1 | The first geometry. |
Geometry | geometry2 | The second geometry. |
Returns
Type | Description |
---|---|
System. |
The distance between the two input geometries in the same unit as the spatial reference of the input geometries. |
Remarks
Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial
reference. Ensure that you understand the potential for error with the geometry's spatial reference.
If you need to calculate more accurate results consider using a different spatial reference, or
using the geodetic equivalent,
Distance
This distance calculation is based upon the Spatial
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.0 - 200.6 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.6 |