ArcGIS Enterprise SDK

ICurve.QueryPointAndDistance Method

Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.

[Visual Basic .NET]Public Sub QueryPointAndDistance ( _ByValextensionAsesriSegmentExtension, _ByValinPointAsIPoint, _ByValasRatioAsBoolean, _ByValoutPointAsIPoint, _ByRefDistanceAlongCurveAsDouble, _ByRefdistanceFromCurveAsDouble, _ByRefbRightSideAsBoolean _)

[C#]publicvoidQueryPointAndDistance (esriSegmentExtensionextension,IPointinPoint,boolasRatio,IPointoutPoint,ref doubleDistanceAlongCurve,ref doubledistanceFromCurve,ref boolbRightSide);

Finds the Point on the specified extended curve nearest to the input point and the distance between those points. Also returns information about the side of the curve the input point is on as well as the distance along the curve that the nearest point occurs.

*AsRatio* is an input parameter that only affects the *DistanceAlongCurve*

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

*DistanceAlongCurve* is an output parameter that represents the distance between the Frompoint of the input curve and the returned point on the curve.

*bRightSide* is an output parameter that tells if the input point is on the right side of the curve. The direction of the curve determines the right and left sides.

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.