Geometry service GetDistance method
The GetDistance method calculates the shortest distance between the input geometries.
GetDistance(SpatialReference SpatialReference, Geometry G1, Geometry G2, LinearUnit DistanceUnit)
Parameter |
Description |
---|---|
SpatialReference |
The SpatialReference of the input. 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 latitude-longitude coordinates. Use GetDistanceGeodesic instead.
2/28/2020