You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>,
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
54
55
-
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>, and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateItem(System.ReadOnlyMemory%7bSystem.Double%7d)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
55
+
and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.Read(PolylineAlgorithm.Internal.PolylineReader)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
A <xref href="System.ReadOnlyMemory%601" data-throw-if-not-resolved="false"></xref> of <xref href="System.Double" data-throw-if-not-resolved="false"></xref> containing the decoded values for this item.
139
-
140
-
The length equals <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>. Implementations should copy values out rather than store the memory.
141
-
- h4: Returns
142
-
- parameters:
143
-
- type:
144
-
- TCoordinate
145
-
description: A <code class="typeparamref">TCoordinate</code> instance representing the decoded item.
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.
The <xref href="PolylineAlgorithm.Internal.PolylineReader" data-throw-if-not-resolved="false"></xref> cursor provided by the engine. Call <xref href="PolylineAlgorithm.Internal.PolylineReader.Read(System.Int32%40)" data-throw-if-not-resolved="false"></xref>
191
+
192
+
once for each expected field value, in the same order used by the corresponding encoder's
193
+
194
+
Write override.
195
+
- h4: Returns
196
+
- parameters:
197
+
- type:
198
+
- TCoordinate
199
+
description: A <code class="typeparamref">TCoordinate</code> instance constructed from the decoded field values.
200
+
- h4: Remarks
201
+
- markdown: >-
202
+
Implementations must always call <xref href="PolylineAlgorithm.Internal.PolylineReader.Read(System.Int32%40)" data-throw-if-not-resolved="false"></xref> the same number of times,
203
+
204
+
in the same field order, for every item. The number of reads must match the number of writes
205
+
206
+
performed by the corresponding encoder's Write override.
Copy file name to clipboardExpand all lines: api-reference/0.0/PolylineAlgorithm.Abstraction.AbstractPolylineEncoder-2.yml
+36-49Lines changed: 36 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ body:
58
58
- markdown: >-
59
59
Derive from this class to implement an encoder for a specific item and polyline type. Override
60
60
61
-
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>, <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.GetValues(%600%2cSystem.Span%7bSystem.Double%7d)" data-throw-if-not-resolved="false"></xref>, and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.CreatePolyline(System.ReadOnlyMemory%7bSystem.Char%7d)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
61
+
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.Write(%600%2cPolylineAlgorithm.Internal.PolylineWriter%40)" data-throw-if-not-resolved="false"></xref>, and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.CreatePolyline(System.ReadOnlySpan%7bSystem.Char%7d)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
- markdown: Encodes a collection of <code class="typeparamref">TCoordinate</code> instances into an encoded <code class="typeparamref">TPolyline</code> string.
156
-
- code: >-
157
-
[SuppressMessage("Design", "MA0051:Method is too long", Justification = "Method contains local methods. Actual method only 55 lines.")]
158
-
159
-
public TPolyline Encode(ReadOnlySpan<TCoordinate> coordinates, CancellationToken cancellationToken = default)
138
+
- code: public TPolyline Encode(ReadOnlySpan<TCoordinate> coordinates, CancellationToken cancellationToken = default)
description: A span that receives the extracted values. Its length equals <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineEncoder%602.ValuesPerItem" data-throw-if-not-resolved="false"></xref>.
The <xref href="PolylineAlgorithm.Internal.PolylineWriter" data-throw-if-not-resolved="false"></xref> cursor provided by the engine. Call <xref href="PolylineAlgorithm.Internal.PolylineWriter.Write(System.Double%2cSystem.Int32%40)" data-throw-if-not-resolved="false"></xref>
194
+
195
+
once for each field value, in a fixed, consistent order. The engine handles delta computation,
196
+
197
+
zigzag encoding, and output buffering.
198
+
- h4: Remarks
199
+
- markdown: >-
200
+
Implementations must always call <xref href="PolylineAlgorithm.Internal.PolylineWriter.Write(System.Double%2cSystem.Int32%40)" data-throw-if-not-resolved="false"></xref> the same number of times,
201
+
202
+
in the same field order, for every item. The corresponding Read override must
203
+
204
+
call <xref href="PolylineAlgorithm.Internal.PolylineReader.Read(System.Int32%40)" data-throw-if-not-resolved="false"></xref> the same number of times in the same order.
218
205
languageId: csharp
219
206
metadata:
220
207
description: Provides a base implementation for encoding sequences of items into encoded polyline strings.
0 commit comments