Table of Contents

Class PolylineEncoderExtensions

Namespace
PolylineAlgorithm.Extensions
Assembly
PolylineAlgorithm.dll

Provides extension methods for the PolylineAlgorithm.Abstraction.IPolylineEncoder`2 interface to facilitate encoding geographic coordinates into polylines.

public static class PolylineEncoderExtensions

Inheritance

Inherited Members

Methods

Encode<TCoordinate, TPolyline>(IPolylineEncoder<TCoordinate, TPolyline>, List<TCoordinate>)

Encodes a List<T> of TCoordinate instances into an encoded polyline.

[SuppressMessage("Design", "CA1002:Do not expose generic lists", Justification = "We need a list as we do need to marshal it as span.")]
[SuppressMessage("Design", "MA0016:Prefer using collection abstraction instead of implementation", Justification = "We need a list as we do need to marshal it as span.")]
public static TPolyline Encode<TCoordinate, TPolyline>(this IPolylineEncoder<TCoordinate, TPolyline> encoder, List<TCoordinate> coordinates)

Parameters

encoder IPolylineEncoder<TCoordinate, TPolyline>

The PolylineAlgorithm.Abstraction.IPolylineEncoder`2 instance used to perform the encoding operation.

coordinates List<TCoordinate>

The list of TCoordinate objects to encode.

Returns

TPolyline

A TPolyline instance representing the encoded polyline for the provided coordinates.

Type Parameters

TCoordinate

The type that represents a geographic coordinate to encode.

TPolyline

The type that represents the encoded polyline output.

Exceptions

ArgumentNullException

Thrown when encoder or coordinates is null.

Encode<TCoordinate, TPolyline>(IPolylineEncoder<TCoordinate, TPolyline>, TCoordinate[])

Encodes an array of TCoordinate instances into an encoded polyline.

public static TPolyline Encode<TCoordinate, TPolyline>(this IPolylineEncoder<TCoordinate, TPolyline> encoder, TCoordinate[] coordinates)

Parameters

encoder IPolylineEncoder<TCoordinate, TPolyline>

The PolylineAlgorithm.Abstraction.IPolylineEncoder`2 instance used to perform the encoding operation.

coordinates TCoordinate[]

The array of TCoordinate objects to encode.

Returns

TPolyline

A TPolyline instance representing the encoded polyline for the provided coordinates.

Type Parameters

TCoordinate

The type that represents a geographic coordinate to encode.

TPolyline

The type that represents the encoded polyline output.

Exceptions

ArgumentNullException

Thrown when encoder or coordinates is null.