Method GetClosestPoint
- Namespace
- GeometryHelper.Spatial
- Assembly
- GeometryHelper.dll
GetClosestPoint(GeoPoint2)
Gets the point of the indexed edges nearest a point.
public GeoPoint2 GetClosestPoint(GeoPoint2 point)
Parameters
pointGeoPoint2
Returns
Exceptions
- InvalidOperationException
Thrown when nothing was indexed.
GetClosestPoint(GeoPoint2, Tolerance)
Gets the point of the indexed edges nearest a point, within a tolerance.
public GeoPoint2 GetClosestPoint(GeoPoint2 point, Tolerance tolerance)
Parameters
Returns
Remarks
A branch whose box is further away than the best found so far cannot hold anything nearer, so it is not looked at. That is the whole of what the tree buys.
A straight edge offers its nearest point as the edge it is however short, as a chain that may curve offers it, and an arc is read within the tolerance: at a hundredth, the index over the polygon (0, 0), (10, 0), (10, 0.006), (0, 10) gives (10.03, 0.003) the closest point (10, 0.003), 0.03 away, where its edge 0.006 long, no longer than the tolerance, offered its start (10, 0), 0.0301496 away; DistanceTo(GeoPoint2, Tolerance) follows it.
Exceptions
- InvalidOperationException
Thrown when nothing was indexed.