Table of Contents

Class PolylineDecoderExtensions

Namespace
PolylineAlgorithm.Extensions
Assembly
PolylineAlgorithm.dll

Provides extension methods for the PolylineAlgorithm.Abstraction.IPolylineDecoder`2 interface to facilitate decoding encoded polylines.

public static class PolylineDecoderExtensions

Inheritance

Inherited Members

Methods

Decode<TValue>(IPolylineDecoder<string, TValue>, char[])

Decodes an encoded polyline represented as a character array into a sequence of geographic coordinates.

public static IEnumerable<TValue> Decode<TValue>(this IPolylineDecoder<string, TValue> decoder, char[] polyline)

Parameters

decoder IPolylineDecoder<string, TValue>

The PolylineAlgorithm.Abstraction.IPolylineDecoder`2 instance used to perform the decoding operation.

polyline char[]

The encoded polyline as a character array to decode. The array is converted to a string internally.

Returns

IEnumerable<TValue>

An IEnumerable<T> of TValue containing the decoded coordinate pairs.

Type Parameters

TValue

The coordinate type returned by the decoder.

Exceptions

ArgumentNullException

Thrown when decoder or polyline is null.

Decode<TValue>(IPolylineDecoder<string, TValue>, ReadOnlyMemory<char>)

Decodes an encoded polyline represented as a read-only memory of characters into a sequence of geographic coordinates.

public static IEnumerable<TValue> Decode<TValue>(this IPolylineDecoder<string, TValue> decoder, ReadOnlyMemory<char> polyline)

Parameters

decoder IPolylineDecoder<string, TValue>

The PolylineAlgorithm.Abstraction.IPolylineDecoder`2 instance used to perform the decoding operation.

polyline ReadOnlyMemory<char>

The encoded polyline as a read-only memory of characters to decode. The memory is converted to a string internally.

Returns

IEnumerable<TValue>

An IEnumerable<T> of TValue containing the decoded coordinate pairs.

Type Parameters

TValue

The coordinate type returned by the decoder.

Exceptions

ArgumentNullException

Thrown when decoder is null.

Decode<TValue>(IPolylineDecoder<ReadOnlyMemory<char>, TValue>, string)

Decodes an encoded polyline string into a sequence of geographic coordinates, using a decoder that accepts ReadOnlyMemory<T> of Char.

public static IEnumerable<TValue> Decode<TValue>(this IPolylineDecoder<ReadOnlyMemory<char>, TValue> decoder, string polyline)

Parameters

decoder IPolylineDecoder<ReadOnlyMemory<char>, TValue>

The PolylineAlgorithm.Abstraction.IPolylineDecoder`2 instance used to perform the decoding operation.

polyline string

The encoded polyline string to decode. The string is converted to ReadOnlyMemory<T> internally.

Returns

IEnumerable<TValue>

An IEnumerable<T> of TValue containing the decoded coordinate pairs.

Type Parameters

TValue

The coordinate type returned by the decoder.

Exceptions

ArgumentNullException

Thrown when decoder or polyline is null.