IGeometry.GetDistanceTo

IGeometry.GetDistanceTo method

Computes the minimum distance between this geometry and a specified geometry.

public double GetDistanceTo(IGeometry other)
ParameterTypeDescription
otherIGeometryA geometry to find distance to.

Return Value

If both geometries are not IsEmpty - a distance between closest points of the geometries. If at least one geometry is empty -1 is returned.

Exceptions

exceptioncondition
ArgumentNullExceptionArgument is null.
ArgumentExceptionSpatialReferenceSystem of geometries are not equivalent. You can use SpatialReferenceSystemTransformation in order to convert geometries to the same spatial reference system.

See Also