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 PolylineDecoderExtensionsInheritance
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
decoderIPolylineDecoder<string, TValue>-
The PolylineAlgorithm.Abstraction.IPolylineDecoder`2 instance used to perform the decoding operation.
polylinechar[]-
The encoded polyline as a character array to decode. The array is converted to a string internally.
Returns
- IEnumerable<TValue>
-
An IEnumerable<T> of
TValuecontaining the decoded coordinate pairs.
Type Parameters
TValue-
The coordinate type returned by the decoder.
Exceptions
- ArgumentNullException
-
Thrown when
decoderorpolylineis 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
decoderIPolylineDecoder<string, TValue>-
The PolylineAlgorithm.Abstraction.IPolylineDecoder`2 instance used to perform the decoding operation.
polylineReadOnlyMemory<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
TValuecontaining the decoded coordinate pairs.
Type Parameters
TValue-
The coordinate type returned by the decoder.
Exceptions
- ArgumentNullException
-
Thrown when
decoderis 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
decoderIPolylineDecoder<ReadOnlyMemory<char>, TValue>-
The PolylineAlgorithm.Abstraction.IPolylineDecoder`2 instance used to perform the decoding operation.
polylinestring-
The encoded polyline string to decode. The string is converted to ReadOnlyMemory<T> internally.
Returns
- IEnumerable<TValue>
-
An IEnumerable<T> of
TValuecontaining the decoded coordinate pairs.
Type Parameters
TValue-
The coordinate type returned by the decoder.
Exceptions
- ArgumentNullException
-
Thrown when
decoderorpolylineis null.