Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
### YamlMime:ApiPage
title: Class AbstractPolylineDecoder<TPolyline, TCoordinate>
body:
- api1: Class AbstractPolylineDecoder<TPolyline, TCoordinate>
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L22
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2
commentId: T:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2
- facts:
- name: Namespace
value:
text: PolylineAlgorithm.Abstraction
url: PolylineAlgorithm.Abstraction.html
- name: Assembly
value: PolylineAlgorithm.dll
- markdown: Provides a base implementation for decoding encoded polyline strings into sequences of geographic coordinates.
- code: 'public abstract class AbstractPolylineDecoder<TPolyline, TCoordinate> : IPolylineDecoder<TPolyline, TCoordinate>'
- h4: Type Parameters
- parameters:
- name: TPolyline
description: The type that represents the encoded polyline input.
- name: TCoordinate
description: The type that represents a decoded geographic coordinate.
- h4: Inheritance
- inheritance:
- text: object
url: https://learn.microsoft.com/dotnet/api/system.object
- text: AbstractPolylineDecoder<TPolyline, TCoordinate>
url: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder-2.html
- h4: Implements
- list:
- text: IPolylineDecoder<TPolyline, TCoordinate>
url: PolylineAlgorithm.Abstraction.IPolylineDecoder-2.html
- h4: Inherited Members
- list:
- text: object.Equals(object)
url: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)
- text: object.Equals(object, object)
url: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)
- text: object.GetHashCode()
url: https://learn.microsoft.com/dotnet/api/system.object.gethashcode
- text: object.GetType()
url: https://learn.microsoft.com/dotnet/api/system.object.gettype
- text: object.MemberwiseClone()
url: https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone
- text: object.ReferenceEquals(object, object)
url: https://learn.microsoft.com/dotnet/api/system.object.referenceequals
- text: object.ToString()
url: https://learn.microsoft.com/dotnet/api/system.object.tostring
- h2: Remarks
- markdown: >-
Derive from this class to implement a decoder for a specific polyline type. Override <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.GetReadOnlyMemory(%600%40)" data-throw-if-not-resolved="false"></xref>

and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateCoordinate(System.Double%2cSystem.Double)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
- h2: Constructors
- api3: AbstractPolylineDecoder()
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L28
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor
- markdown: Initializes a new instance of the <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602" data-throw-if-not-resolved="false"></xref> class with default encoding options.
- code: protected AbstractPolylineDecoder()
- api3: AbstractPolylineDecoder(PolylineEncodingOptions)
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor_PolylineAlgorithm_PolylineEncodingOptions_
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L40
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions)
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions)
- markdown: Initializes a new instance of the <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602" data-throw-if-not-resolved="false"></xref> class with the specified encoding options.
- code: protected AbstractPolylineDecoder(PolylineEncodingOptions options)
- h4: Parameters
- parameters:
- name: options
type:
- text: PolylineEncodingOptions
url: PolylineAlgorithm.PolylineEncodingOptions.html
description: The <xref href="PolylineAlgorithm.PolylineEncodingOptions" data-throw-if-not-resolved="false"></xref> to use for encoding operations.
- h4: Exceptions
- parameters:
- type:
- text: ArgumentNullException
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
description: Thrown when <code class="paramref">options</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
- h2: Properties
- api3: Options
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Options
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L54
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options
commentId: P:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options
- markdown: Gets the encoding options used by this polyline decoder.
- code: public PolylineEncodingOptions Options { get; }
- h4: Property Value
- parameters:
- type:
- text: PolylineEncodingOptions
url: PolylineAlgorithm.PolylineEncodingOptions.html
- h2: Methods
- api3: CreateCoordinate(double, double)
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_CreateCoordinate_System_Double_System_Double_
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L202
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double)
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double)
- markdown: Creates a <code class="typeparamref">TCoordinate</code> instance from the specified latitude and longitude values.
- code: protected abstract TCoordinate CreateCoordinate(double latitude, double longitude)
- h4: Parameters
- parameters:
- name: latitude
type:
- text: double
url: https://learn.microsoft.com/dotnet/api/system.double
description: The latitude component of the coordinate, in degrees.
- name: longitude
type:
- text: double
url: https://learn.microsoft.com/dotnet/api/system.double
description: The longitude component of the coordinate, in degrees.
- h4: Returns
- parameters:
- type:
- TCoordinate
description: A <code class="typeparamref">TCoordinate</code> instance representing the specified geographic coordinate.
- api3: Decode(TPolyline, CancellationToken)
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Decode__0_System_Threading_CancellationToken_
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L81
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
- markdown: >-
Decodes an encoded <code class="typeparamref">TPolyline</code> into a sequence of <code class="typeparamref">TCoordinate</code> instances,

with support for cancellation.
- code: public IEnumerable<TCoordinate> Decode(TPolyline polyline, CancellationToken cancellationToken = default)
- h4: Parameters
- parameters:
- name: polyline
type:
- TPolyline
description: The <code class="typeparamref">TPolyline</code> instance containing the encoded polyline string to decode.
- name: cancellationToken
type:
- text: CancellationToken
url: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
description: A <xref href="System.Threading.CancellationToken" data-throw-if-not-resolved="false"></xref> that can be used to cancel the decoding operation.
optional: true
- h4: Returns
- parameters:
- type:
- text: IEnumerable
url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
- <
- TCoordinate
- '>'
description: An <xref href="System.Collections.Generic.IEnumerable%601" data-throw-if-not-resolved="false"></xref> of <code class="typeparamref">TCoordinate</code> representing the decoded latitude and longitude pairs.
- h4: Exceptions
- parameters:
- type:
- text: ArgumentNullException
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
description: Thrown when <code class="paramref">polyline</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
- type:
- text: ArgumentException
url: https://learn.microsoft.com/dotnet/api/system.argumentexception
description: Thrown when <code class="paramref">polyline</code> is empty.
- type:
- text: InvalidPolylineException
url: PolylineAlgorithm.InvalidPolylineException.html
description: Thrown when the polyline format is invalid or malformed at a specific position.
- type:
- text: OperationCanceledException
url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception
description: Thrown when <code class="paramref">cancellationToken</code> is canceled during decoding.
- api3: GetReadOnlyMemory(in TPolyline)
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_GetReadOnlyMemory__0__
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L187
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
- markdown: Extracts the underlying read-only memory region of characters from the specified polyline instance.
- code: protected abstract ReadOnlyMemory<char> GetReadOnlyMemory(in TPolyline polyline)
- h4: Parameters
- parameters:
- name: polyline
type:
- TPolyline
description: The <code class="typeparamref">TPolyline</code> instance from which to extract the character sequence.
- h4: Returns
- parameters:
- type:
- text: ReadOnlyMemory
url: https://learn.microsoft.com/dotnet/api/system.readonlymemory-1
- <
- text: char
url: https://learn.microsoft.com/dotnet/api/system.char
- '>'
description: A <xref href="System.ReadOnlyMemory%601" data-throw-if-not-resolved="false"></xref> of <xref href="System.Char" data-throw-if-not-resolved="false"></xref> representing the encoded polyline characters.
- api3: ValidateFormat(ReadOnlyMemory<char>, ILogger?)
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_ValidateFormat_System_ReadOnlyMemory_System_Char__Microsoft_Extensions_Logging_ILogger_
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/dependabot/nuget/src/PolylineAlgorithm/Microsoft.Extensions.Logging.Abstractions-9.0.15/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L167
metadata:
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)
- markdown: Validates the format of the polyline character sequence, ensuring all characters are within the allowed range.
- code: protected virtual void ValidateFormat(ReadOnlyMemory<char> sequence, ILogger? logger)
- h4: Parameters
- parameters:
- name: sequence
type:
- text: ReadOnlyMemory
url: https://learn.microsoft.com/dotnet/api/system.readonlymemory-1
- <
- text: char
url: https://learn.microsoft.com/dotnet/api/system.char
- '>'
description: The read-only memory region of characters representing the polyline to validate.
- name: logger
type:
- text: ILogger
url: https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger
- '?'
description: An optional <xref href="Microsoft.Extensions.Logging.ILogger" data-throw-if-not-resolved="false"></xref> used to log a warning when format validation fails.
- h4: Exceptions
- parameters:
- type:
- text: ArgumentException
url: https://learn.microsoft.com/dotnet/api/system.argumentexception
description: Thrown when the polyline contains characters outside the valid encoding range or has an invalid block structure.
languageId: csharp
metadata:
description: Provides a base implementation for decoding encoded polyline strings into sequences of geographic coordinates.
Loading
Loading