ESRI.ArcGIS.Mobile
GetNearestVertex Method
See Also  Send Feedback
ESRI.ArcGIS.Mobile.Geometries Namespace > CoordinateCollection Class : GetNearestVertex Method

inputCoordinate
Input coordinate to compare to.
queryNearestVertex
Set in this coordinate the nearest vertex coordinate.
vertexIndex
Returns the vertex index in the part.
squareDistanceFound
Returns the square distance to the closest vertex.
Gets the nearest coordinate on the geometry using an input point location

Syntax

Visual Basic (Declaration) 
Public Function GetNearestVertex( _
   ByVal inputCoordinate As Coordinate, _
   ByVal queryNearestVertex As Coordinate, _
   ByRef vertexIndex As Integer, _
   ByRef squareDistanceFound As Double _
) As Boolean
C# 
public bool GetNearestVertex( 
   Coordinate inputCoordinate,
   Coordinate queryNearestVertex,
   ref int vertexIndex,
   ref double squareDistanceFound
)

Parameters

inputCoordinate
Input coordinate to compare to.
queryNearestVertex
Set in this coordinate the nearest vertex coordinate.
vertexIndex
Returns the vertex index in the part.
squareDistanceFound
Returns the square distance to the closest vertex.

Exceptions

ExceptionDescription
ArgumentNullExceptionNull inputCoordinate or null nearestVertex.

Remarks

You can use GetNearestVertex to determine which coordinate on the coordinate collection is closest to a particular point location. For example, you might be interested to determine how close the current mouse location is to a particular coordinate collection, and further what coordinate on that coordinate collection is the closest. You must supply a reference for a returned distance. This distance will be in map units. Use the return distance to determine if the return coordinate is the closet coordinate to the mouse location.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also