This document is archived and information here might be outdated. Recommended version. |
Copies into 'nearest' a point on this geometry nearest to the input point.
[Visual Basic .NET] Public Sub QueryNearestPoint3D ( _ ByVal pInP As IPoint, _ ByVal extension As esriSegmentExtension, _ ByVal pNearest As IPoint _ )
[C#] public void QueryNearestPoint3D ( IPoint pInP, esriSegmentExtension extension, IPoint pNearest );
[C++]
HRESULT QueryNearestPoint3D(
IPoint* pInP,
esriSegmentExtension extension,
IPoint* pNearest
);
[C++]
Parameters pInP
pInP is a parameter of type IPoint* extension
extension is a parameter of type esriSegmentExtension pNearest
pNearest is a parameter of type IPoint*
Queries the nearest point on a z aware geometry to the input point in 3D space. Depending on the method of segment extension, the nearest point can also be found on an extension of the geometry.
If the geometry is an Envelope and the input point is located within the bounds of the Envelope, QueryNearestPoint3D will return a point on the exterior of the Envelope nearest the input point.
public static void QueryNearestPoint3D()
{
IGeometry pointGeometry=GetPointGeometry();
IGeometry envelopeGeometry=GetEnvelopeGeometry();
IProximityOperator3DÂ proximityOperator3D=envelopeGeometry as IProximityOperator3D;
IPoint nearestPoint3D=new PointClass();
proximityOperator3D.QueryNearestPoint3D(pointGeometry as IPoint, esriSegmentExtension.esriNoExtension, nearestPoint3D);
//nearestPoint3D =Â (5.393, -0.583, -6.043)
}