Calculates the shortest distance between the two input geometries.
GetDistance(SpatialReference SpatialReference, Geometry G1, Geometry G2, LinearUnit DistanceUnit)
Parameter |
Description |
SpatialReference |
The spatial reference of the geometries in G1 and G2. This cannot be null. |
G1 |
A geometry of any type. |
G2 |
A geometry of any type. |
DistanceUnit |
(Optional) The unit of measure in which distance will be reported. |
Return Value
A double reporting the shortest distance between G1 and G2.
Remarks
The distance value is computed in the specified linear units, if present, or in the units of the spatial reference.
It is not recommended that this method be used on geometries with lat-long coordinates. Use GetDistanceGeodesic instead.