ArcObjects Library Reference (Geometry)  

ICurve3.QueryPointsAndDistances Method

Given an input point, calculates the minimum distance to the geometry and provides an enumerator over all closest points on the geometry, along with additional information.

[Visual Basic .NET]
Public Sub QueryPointsAndDistances ( _
    ByVal extension As esriSegmentExtension, _
    ByVal searchRadius As Double, _
    ByVal inPoint As IPoint, _
    ByVal asRatio As Boolean, _
    ByRef distanceFromCurve As Double, _
    ByRef pointsAndDistances As IEnumPointAndDistance _
)
[C#]
public void QueryPointsAndDistances (
    esriSegmentExtension extension,
    double searchRadius,
    IPoint inPoint,
    bool asRatio,
    ref double distanceFromCurve,
    ref IEnumPointAndDistance pointsAndDistances
);
[C++]
HRESULT QueryPointsAndDistances(
  esriSegmentExtension extension,
  double searchRadius,
  IPoint* inPoint,
  VARIANT_BOOL asRatio,
  double* distanceFromCurve,
  IEnumPointAndDistance** pointsAndDistances
);
[C++]

Parameters

extension

  extension is a parameter of type esriSegmentExtension

searchRadius   searchRadius is a parameter of type double inPoint [in]

  inPoint is a parameter of type IPoint

asRatio   asRatio is a parameter of type VARIANT_BOOL distanceFromCurve [in, out]   distanceFromCurve is a parameter of type double pointsAndDistances [out]

  pointsAndDistances is a parameter of type IEnumPointAndDistance

Product Availability

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

Description

This method is similar to QueryPointsAndDistance; but it handles the case where the location of the minimum distance is not unique (See picture below). QueryPointAndDistance returns only the first location, this method returns all locations of minimum distance.

Remarks

AsRatio is an input parameter that only affects the DistanceAlongCurvereturned as part of the output IEnumPointAndDistance enumerator.

distanceFromCurve is an output parameter that represents the minimum distance between the curve and the input point.

IEnumPointAndDistance is an enumerator (it inherits from IEnumVertex) over all nearest points on the curve

See Also

ICurve3 Interface