ESRI.ArcGIS.Mobile
GetNearestVertex(Coordinate,Coordinate,Int32,Int32,Double) Method
See Also  Send Feedback
ESRI.ArcGIS.Mobile.Geometries Namespace > Geometry Class > GetNearestVertex Method : GetNearestVertex(Coordinate,Coordinate,Int32,Int32,Double) Method

inputCoordinate
Input coordinate to compare to.
nearestVertex
Returns the nearest vertex coordinate.
partIndex
Returns the part index of the nearest coordinate.
vertexIndex
Returns the vertex index in the part.
squareDistanceFound
Returns the square distance to the closest vertex.
Finds the nearest vertex on the geometry to an input Coordinate

Syntax

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

Parameters

inputCoordinate
Input coordinate to compare to.
nearestVertex
Returns the nearest vertex coordinate.
partIndex
Returns the part index of the nearest 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 geometry 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 geometry, and further what coordinate on that geometry 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

Target 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