|
| 1 | +### YamlMime:ApiPage |
| 2 | +title: Class AbstractPolylineDecoder<TPolyline, TCoordinate> |
| 3 | +body: |
| 4 | +- api1: Class AbstractPolylineDecoder<TPolyline, TCoordinate> |
| 5 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2 |
| 6 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L22 |
| 7 | + metadata: |
| 8 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2 |
| 9 | + commentId: T:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2 |
| 10 | +- facts: |
| 11 | + - name: Namespace |
| 12 | + value: |
| 13 | + text: PolylineAlgorithm.Abstraction |
| 14 | + url: PolylineAlgorithm.Abstraction.html |
| 15 | + - name: Assembly |
| 16 | + value: PolylineAlgorithm.dll |
| 17 | +- markdown: Provides a base implementation for decoding encoded polyline strings into sequences of geographic coordinates. |
| 18 | +- code: 'public abstract class AbstractPolylineDecoder<TPolyline, TCoordinate> : IPolylineDecoder<TPolyline, TCoordinate>' |
| 19 | +- h4: Type Parameters |
| 20 | +- parameters: |
| 21 | + - name: TPolyline |
| 22 | + description: The type that represents the encoded polyline input. |
| 23 | + - name: TCoordinate |
| 24 | + description: The type that represents a decoded geographic coordinate. |
| 25 | +- h4: Inheritance |
| 26 | +- inheritance: |
| 27 | + - text: object |
| 28 | + url: https://learn.microsoft.com/dotnet/api/system.object |
| 29 | + - text: AbstractPolylineDecoder<TPolyline, TCoordinate> |
| 30 | + url: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder-2.html |
| 31 | +- h4: Implements |
| 32 | +- list: |
| 33 | + - text: IPolylineDecoder<TPolyline, TCoordinate> |
| 34 | + url: PolylineAlgorithm.Abstraction.IPolylineDecoder-2.html |
| 35 | +- h4: Inherited Members |
| 36 | +- list: |
| 37 | + - text: object.Equals(object) |
| 38 | + url: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object) |
| 39 | + - text: object.Equals(object, object) |
| 40 | + url: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object) |
| 41 | + - text: object.GetHashCode() |
| 42 | + url: https://learn.microsoft.com/dotnet/api/system.object.gethashcode |
| 43 | + - text: object.GetType() |
| 44 | + url: https://learn.microsoft.com/dotnet/api/system.object.gettype |
| 45 | + - text: object.MemberwiseClone() |
| 46 | + url: https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone |
| 47 | + - text: object.ReferenceEquals(object, object) |
| 48 | + url: https://learn.microsoft.com/dotnet/api/system.object.referenceequals |
| 49 | + - text: object.ToString() |
| 50 | + url: https://learn.microsoft.com/dotnet/api/system.object.tostring |
| 51 | +- h2: Remarks |
| 52 | +- markdown: >- |
| 53 | + 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> |
| 54 | +
|
| 55 | + and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateCoordinate(System.Double%2cSystem.Double)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior. |
| 56 | +- h2: Constructors |
| 57 | +- api3: AbstractPolylineDecoder() |
| 58 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor |
| 59 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L28 |
| 60 | + metadata: |
| 61 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor |
| 62 | + commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor |
| 63 | +- 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. |
| 64 | +- code: protected AbstractPolylineDecoder() |
| 65 | +- api3: AbstractPolylineDecoder(PolylineEncodingOptions) |
| 66 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor_PolylineAlgorithm_PolylineEncodingOptions_ |
| 67 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L40 |
| 68 | + metadata: |
| 69 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions) |
| 70 | + commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions) |
| 71 | +- 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. |
| 72 | +- code: protected AbstractPolylineDecoder(PolylineEncodingOptions options) |
| 73 | +- h4: Parameters |
| 74 | +- parameters: |
| 75 | + - name: options |
| 76 | + type: |
| 77 | + - text: PolylineEncodingOptions |
| 78 | + url: PolylineAlgorithm.PolylineEncodingOptions.html |
| 79 | + description: The <xref href="PolylineAlgorithm.PolylineEncodingOptions" data-throw-if-not-resolved="false"></xref> to use for encoding operations. |
| 80 | +- h4: Exceptions |
| 81 | +- parameters: |
| 82 | + - type: |
| 83 | + - text: ArgumentNullException |
| 84 | + url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception |
| 85 | + description: Thrown when <code class="paramref">options</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>. |
| 86 | +- h2: Properties |
| 87 | +- api3: Options |
| 88 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Options |
| 89 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L54 |
| 90 | + metadata: |
| 91 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options |
| 92 | + commentId: P:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options |
| 93 | +- markdown: Gets the encoding options used by this polyline decoder. |
| 94 | +- code: public PolylineEncodingOptions Options { get; } |
| 95 | +- h4: Property Value |
| 96 | +- parameters: |
| 97 | + - type: |
| 98 | + - text: PolylineEncodingOptions |
| 99 | + url: PolylineAlgorithm.PolylineEncodingOptions.html |
| 100 | +- h2: Methods |
| 101 | +- api3: CreateCoordinate(double, double) |
| 102 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_CreateCoordinate_System_Double_System_Double_ |
| 103 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L202 |
| 104 | + metadata: |
| 105 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double) |
| 106 | + commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double) |
| 107 | +- markdown: Creates a <code class="typeparamref">TCoordinate</code> instance from the specified latitude and longitude values. |
| 108 | +- code: protected abstract TCoordinate CreateCoordinate(double latitude, double longitude) |
| 109 | +- h4: Parameters |
| 110 | +- parameters: |
| 111 | + - name: latitude |
| 112 | + type: |
| 113 | + - text: double |
| 114 | + url: https://learn.microsoft.com/dotnet/api/system.double |
| 115 | + description: The latitude component of the coordinate, in degrees. |
| 116 | + - name: longitude |
| 117 | + type: |
| 118 | + - text: double |
| 119 | + url: https://learn.microsoft.com/dotnet/api/system.double |
| 120 | + description: The longitude component of the coordinate, in degrees. |
| 121 | +- h4: Returns |
| 122 | +- parameters: |
| 123 | + - type: |
| 124 | + - TCoordinate |
| 125 | + description: A <code class="typeparamref">TCoordinate</code> instance representing the specified geographic coordinate. |
| 126 | +- api3: Decode(TPolyline, CancellationToken) |
| 127 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Decode__0_System_Threading_CancellationToken_ |
| 128 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L81 |
| 129 | + metadata: |
| 130 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken) |
| 131 | + commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken) |
| 132 | +- markdown: >- |
| 133 | + Decodes an encoded <code class="typeparamref">TPolyline</code> into a sequence of <code class="typeparamref">TCoordinate</code> instances, |
| 134 | +
|
| 135 | + with support for cancellation. |
| 136 | +- code: public IEnumerable<TCoordinate> Decode(TPolyline polyline, CancellationToken cancellationToken = default) |
| 137 | +- h4: Parameters |
| 138 | +- parameters: |
| 139 | + - name: polyline |
| 140 | + type: |
| 141 | + - TPolyline |
| 142 | + description: The <code class="typeparamref">TPolyline</code> instance containing the encoded polyline string to decode. |
| 143 | + - name: cancellationToken |
| 144 | + type: |
| 145 | + - text: CancellationToken |
| 146 | + url: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken |
| 147 | + description: A <xref href="System.Threading.CancellationToken" data-throw-if-not-resolved="false"></xref> that can be used to cancel the decoding operation. |
| 148 | + optional: true |
| 149 | +- h4: Returns |
| 150 | +- parameters: |
| 151 | + - type: |
| 152 | + - text: IEnumerable |
| 153 | + url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1 |
| 154 | + - < |
| 155 | + - TCoordinate |
| 156 | + - '>' |
| 157 | + 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. |
| 158 | +- h4: Exceptions |
| 159 | +- parameters: |
| 160 | + - type: |
| 161 | + - text: ArgumentNullException |
| 162 | + url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception |
| 163 | + description: Thrown when <code class="paramref">polyline</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>. |
| 164 | + - type: |
| 165 | + - text: ArgumentException |
| 166 | + url: https://learn.microsoft.com/dotnet/api/system.argumentexception |
| 167 | + description: Thrown when <code class="paramref">polyline</code> is empty. |
| 168 | + - type: |
| 169 | + - text: InvalidPolylineException |
| 170 | + url: PolylineAlgorithm.InvalidPolylineException.html |
| 171 | + description: Thrown when the polyline format is invalid or malformed at a specific position. |
| 172 | + - type: |
| 173 | + - text: OperationCanceledException |
| 174 | + url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception |
| 175 | + description: Thrown when <code class="paramref">cancellationToken</code> is canceled during decoding. |
| 176 | +- api3: GetReadOnlyMemory(in TPolyline) |
| 177 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_GetReadOnlyMemory__0__ |
| 178 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L187 |
| 179 | + metadata: |
| 180 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@) |
| 181 | + commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@) |
| 182 | +- markdown: Extracts the underlying read-only memory region of characters from the specified polyline instance. |
| 183 | +- code: protected abstract ReadOnlyMemory<char> GetReadOnlyMemory(in TPolyline polyline) |
| 184 | +- h4: Parameters |
| 185 | +- parameters: |
| 186 | + - name: polyline |
| 187 | + type: |
| 188 | + - TPolyline |
| 189 | + description: The <code class="typeparamref">TPolyline</code> instance from which to extract the character sequence. |
| 190 | +- h4: Returns |
| 191 | +- parameters: |
| 192 | + - type: |
| 193 | + - text: ReadOnlyMemory |
| 194 | + url: https://learn.microsoft.com/dotnet/api/system.readonlymemory-1 |
| 195 | + - < |
| 196 | + - text: char |
| 197 | + url: https://learn.microsoft.com/dotnet/api/system.char |
| 198 | + - '>' |
| 199 | + 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. |
| 200 | +- api3: ValidateFormat(ReadOnlyMemory<char>, ILogger?) |
| 201 | + id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_ValidateFormat_System_ReadOnlyMemory_System_Char__Microsoft_Extensions_Logging_ILogger_ |
| 202 | + src: https://github.com/petesramek/polyline-algorithm-csharp/blob/bugfix/incorrect-normalization/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L167 |
| 203 | + metadata: |
| 204 | + uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger) |
| 205 | + commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger) |
| 206 | +- markdown: Validates the format of the polyline character sequence, ensuring all characters are within the allowed range. |
| 207 | +- code: protected virtual void ValidateFormat(ReadOnlyMemory<char> sequence, ILogger? logger) |
| 208 | +- h4: Parameters |
| 209 | +- parameters: |
| 210 | + - name: sequence |
| 211 | + type: |
| 212 | + - text: ReadOnlyMemory |
| 213 | + url: https://learn.microsoft.com/dotnet/api/system.readonlymemory-1 |
| 214 | + - < |
| 215 | + - text: char |
| 216 | + url: https://learn.microsoft.com/dotnet/api/system.char |
| 217 | + - '>' |
| 218 | + description: The read-only memory region of characters representing the polyline to validate. |
| 219 | + - name: logger |
| 220 | + type: |
| 221 | + - text: ILogger |
| 222 | + url: https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger |
| 223 | + - '?' |
| 224 | + 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. |
| 225 | +- h4: Exceptions |
| 226 | +- parameters: |
| 227 | + - type: |
| 228 | + - text: ArgumentException |
| 229 | + url: https://learn.microsoft.com/dotnet/api/system.argumentexception |
| 230 | + description: Thrown when the polyline contains characters outside the valid encoding range or has an invalid block structure. |
| 231 | +languageId: csharp |
| 232 | +metadata: |
| 233 | + description: Provides a base implementation for decoding encoded polyline strings into sequences of geographic coordinates. |
0 commit comments