Table of Contents

Method ToGeoLine2s

Namespace
GeometryHelper.Extension
Assembly
GeometryHelper.dll

ToGeoLine2s(List<GeoPoint2>)

Builds the open chain of line segments running through the points, one segment per consecutive pair.

The chain is not closed: nothing joins the last point back to the first, so a ring has to repeat its first point at the end to come out closed. A list of n points yields n - 1 segments, and a list of fewer than two points yields none rather than failing.

Coincident neighbours are not filtered, so a repeated point produces a zero length segment. Run RemoveConsecutiveNearPoints(List<GeoPoint2>, Tolerance) first when that matters.

public static List<GeoLine2> ToGeoLine2s(this List<GeoPoint2> points)

Parameters

points List<GeoPoint2>

The points to connect, in order.

Returns

List<GeoLine2>

The segments joining each point to the one after it.

Exceptions

ArgumentNullException

Thrown when points is null.