GeoLineString Class

A line through positions, such as a river, a road or a route.

public sealed class GeoLineString : GeoGeometry
Inheritance
GeoGeometry GeoLineString

Constructors

NameDescription
GeoLineString(IEnumerable<GeoPosition>)Initializes a new instance of the GeoLineString class.

GeoLineString(IEnumerable<GeoPosition>)

GeoLineString.cs

Initializes a new instance of the GeoLineString class.

public GeoLineString(IEnumerable<GeoPosition> positions)

Parameters

positions IEnumerable<GeoPosition>
The positions, in order.

Properties

NameDescription
PositionsGets the positions, in order.
TypeGets the type of the geometry.

Gets the positions, in order.

public IReadOnlyList<GeoPosition> Positions { get; }

Gets the type of the geometry.

public override GeoGeometryType Type { get; }

Property value

GeoGeometryType

Methods

NameDescription
GetLength()Gets the length of the line, in meters: the sum of the great-circle distances between its positions.
GetPositions()Gets the positions of the geometry: every position of every point, line and ring, in order.

GetLength()

GeoLineString.cs

Gets the length of the line, in meters: the sum of the great-circle distances between its positions.

public double GetLength()

Returns

double The length, in meters.

GetPositions()

GeoLineString.cs

Gets the positions of the geometry: every position of every point, line and ring, in order.

public override IEnumerable<GeoPosition> GetPositions()

Returns

IEnumerable<GeoPosition> The positions.