ArcObjects Library Reference (Geometry)  

IProximityOperator.ReturnDistance Method

Returns the minimum distance between two geometries.

[Visual Basic .NET]
Public Function ReturnDistance ( _
    ByVal other As IGeometry _
) As Double
[C#]
public double ReturnDistance (
    IGeometry other
);
[C++]
HRESULT ReturnDistance(
  IGeometry* other,
  double* distance
);
[C++]

Parameters

other

  other is a parameter of type IGeometry

distance [out, retval]   distance is a parameter of type double

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Returns the minimum distance between two geometries.  If the geometries intersect, the minimum distance is 0.  Only returns the distance, and not the nearest points.

Remarks

 

ReturnDistance Example

The geometry combinations which can be used with ReturnDistance are:

Point: Point, MultiPoint, Envelope, Polyline, Polygon, Line, CircularArc, EllipticArc, BezierCurve.
Multipoint: Point, MultiPoint, Envelope, Polyline, Polygon.
Envelope: Point, MultiPoint, Envelope, Line, CircularArc, EllipticArc, BezierCurve, PolyLine, Polygon.
PolyLine: Point, Multipoint, Envelope, PolyLine, Polygon.
Polygon: Point, Multipoint, Envelope, PolyLine, Polygon.
Line: Point, Envelope, Line, CircularArc, EllipticArc, BezierCurve.
CircularArc: Point, Envelope, Line, CircularArc, EllipticArc (not implemented yet), BezierCurve.
EllipticArc: Point, Envelope, Line, CircularArc (not implemented yet), EllipticArc (not implemented yet), BezierCurve (not implemented yet).
BezierCurve: Point, Envelope, Line, CircularArc, EllipticArc (not implemented yet), BezierCurve.

Note: To get the distance between a segment (Line, CircularArc, EllipticArc, BezierCurve) and a MultiPoint, PolyLine or Polygon, add that segment to a PolyLine.

See Also

IProximityOperator Interface