public ProximityResult NearestPoint( Geometry geometry, MapPoint point )
Public Function NearestPoint( _ ByVal geometry As Geometry, _ ByVal point As MapPoint _ ) As ProximityResult
Parameters
- geometry
- The geometry.
- point
- The point to which the returned point will be nearest.
Return Value
If the input geometry is a non-empty point, then ProximityResult.PointIndex = 0, ProximityResult.PartIndex = 0, and ProximityResult.SegmentIndex is null.
If the input geometry is a non-empty multipoint, ProximityResult.PointIndex is the index of the nearest point in the Multipoint, ProximityResult.PartIndex = ProximityResult.PointIndex, and ProximityResult.SegmentIndex is null.
Otherwise, if the input geometry is non-empty, then ProximityResult.PointIndex is null and ProximityResult.SegmentIndex is the segment which contains the nearest point. The segment index is relative to the ProximityResult.PartIndex. For example, if the segment index = 0 and the part index = 2, then the segment containing the nearest point is segment 0 of part 2. In other words, the segment is the first segment of the third part.
ProximityResult.RightSide specifies if the input query point is on the right side of the input geometry or not.
If either of the input geometries are empty, then ProximityResult.Distance = -1, ProximityResult.Point is empty, ProximityResult.RightSide = false, ProximityResult.PartIndex = -1, ProximityResult.PointIndex is null, and ProximityResult.SegmentIndex = null.