Table of Contents

Method ProjectToPolyline

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

ProjectToPolyline(GeoPolyline2, GeoPoint2)

Projects a point orthogonally onto a polyline using default tolerance.

public static GeoPoint2 ProjectToPolyline(GeoPolyline2 polyline, GeoPoint2 point)

Parameters

polyline GeoPolyline2

The polyline.

point GeoPoint2

The target point.

Returns

GeoPoint2

The closest point on the polyline.

ProjectToPolyline(GeoPolyline2, GeoPoint2, Tolerance)

Projects a point orthogonally onto a polyline within tolerance (finds the closest point across all segments). The result always lies on the path.

public static GeoPoint2 ProjectToPolyline(GeoPolyline2 polyline, GeoPoint2 point, Tolerance tolerance)

Parameters

polyline GeoPolyline2

The polyline.

point GeoPoint2

The target point.

tolerance Tolerance

The tolerance; every leg is measured as it is, so it changes nothing here.

Returns

GeoPoint2

The closest point on the polyline.

Remarks

A leg offers its nearest point as the leg it is however short, as the distance measures it, where a segment no longer than the tolerance on its own is read as its start: at a hundredth, the polyline (0, 0), (10, 0), (10, 0.006), (0, 0.006) is 0.03 from (10.03, 0.003), and the closest point is (10, 0.003), 0.03 away, where its leg 0.006 long, no longer than the tolerance, offered its start (10, 0), 0.0301496 away.