IProximityOperator3D Interface

Provides access to members that find the 3D distance between two geometries with Zs.

Description

This interface is new at ArcGIS 9.3.

Returns the point on the input geometry that is closest to the input point, and returns the 3D distance between these two points. In contrast to IProximityOperator, Z values are taken into account when determining whether the given relationship exists.

Members

Name Description
Method QueryNearestPoint3D Copies into 'nearest' a point on this geometry nearest to the input point.
Method ReturnDistance3D Returns the minimal distance between two geometries.
Method ReturnNearestPoint3D Creates and returns a point on this geometry nearest to the input point.

IProximityOperator3D.QueryNearestPoint3D Method

Copies into 'nearest' a point on this geometry nearest to the input point.

Public Sub QueryNearestPoint3D ( _
    ByVal pInP As IPoint, _
    ByVal extension As esriSegmentExtension, _
    ByVal pNearest As IPoint _
)
public void QueryNearestPoint3D (
    IPoint pInP,
    esriSegmentExtension extension,
    IPoint pNearest
);

Description

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.

Remarks

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) 

}

IProximityOperator3D.ReturnDistance3D Method

Returns the minimal distance between two geometries.

Public Function ReturnDistance3D ( _
    ByVal pOther As IGeometry _
) As Double
public double ReturnDistance3D (
    IGeometry pOther
);

Description

Returns the minimum distance between two z aware geometries in 3D space. If the geometries intersect, the minimum distance is 0. Only returns the distance, and not the nearest points.

public static void ReturnDistance3D()

          {

                  IGeometry  pointGeometry = GetPointGeometry();

 

                 IGeometry  envelopeGeometry = GetEnvelopeGeometry();

  

                IProximityOperator3D proximityOperator3D = envelopeGeometry as IProximityOperator3D;



                 double distance3D = proximityOperator3D.ReturnDistance3D(pointGeometry);

 

                 //distance3D = 13.971

         }

IProximityOperator3D.ReturnNearestPoint3D Method

Creates and returns a point on this geometry nearest to the input point.

Public Function ReturnNearestPoint3D ( _
    ByVal pInP As IPoint, _
    ByVal extension As esriSegmentExtension _
) As IPoint
public IPoint ReturnNearestPoint3D (
    IPoint pInP,
    esriSegmentExtension extension
);

Description

Finds and returns the nearest point, in 3D space, on a z aware geometry to the input point. Depending on the method of segment extension, the nearest point can also be found on an extension of the geometry.

Remarks

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 ReturnNearestPoint3D()

          {

                  IGeometry  pointGeometry = GetPointGeometry();

 

                 IGeometry  envelopeGeometry = GetEnvelopeGeometry();

  

                IProximityOperator3D proximityOperator3D = envelopeGeometry as IProximityOperator3D;



                 IPoint  nearestPoint3D = proximityOperator3D.ReturnNearestPoint3D(pointGeometry as IPoint, esriSegmentExtension.esriNoExtension);

 

                 //nearestPoint3D = (5.393, -0.583, -6.043)

         }

Classes that implement IProximityOperator3D

Classes Description
Envelope A rectangle with sides parallel to a coordinate system defining the extent of another geometry; optionally has min and max measure, height and ID attributes.
Line A 2D straight line between a pair of 2D endpoints; can optionally have height, measure and ID attributes at each endpoint.
MultiPatch A collection of surface patches.
Multipoint An ordered collection of points; optionally has measure, height and ID attributes.
Point A two dimensional point, optionally with measure, height, and ID attributes.
Polygon A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.
Polyline An ordered collection of paths; optionally has measure, height and ID attributes.

Remarks

These methods are intended to be called against top-level geometries only (Point, Multipoint, Polyline, Polygon, Envelope, MultiPatch). To call a method against a Segment/Path or Ring, first add the part to a Polyline or Polygon container, respectively, and then call the appropriate method against the container.These methods treat MultiPatch geometries as shell representations, where the interior is not considered part of the geometry. Consequently, a point situated inside a MultiPatch that does not touch one of its surfaces will be classified as disjoint from that MultiPatch.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.