Skip to content

Commit 1ee3127

Browse files
committed
Updated docs for version 1.0
1 parent bd09d87 commit 1ee3127

11 files changed

Lines changed: 565 additions & 152 deletions

api-reference/1.0/PolylineAlgorithm.Abstraction.AbstractPolylineDecoder-2.yml

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Class AbstractPolylineDecoder<TPolyline, TCoordinate>
33
body:
44
- api1: Class AbstractPolylineDecoder<TPolyline, TCoordinate>
55
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2
6-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L23
6+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L21
77
metadata:
88
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2
99
commentId: T:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2
@@ -56,15 +56,15 @@ body:
5656
- h2: Constructors
5757
- api3: AbstractPolylineDecoder()
5858
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor
59-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L29
59+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L27
6060
metadata:
6161
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor
6262
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor
6363
- 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.
6464
- code: protected AbstractPolylineDecoder()
6565
- api3: AbstractPolylineDecoder(PolylineEncodingOptions)
6666
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor_PolylineAlgorithm_PolylineEncodingOptions_
67-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L41
67+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L39
6868
metadata:
6969
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions)
7070
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions)
@@ -86,7 +86,7 @@ body:
8686
- h2: Properties
8787
- api3: Options
8888
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Options
89-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L55
89+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L53
9090
metadata:
9191
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options
9292
commentId: P:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options
@@ -100,7 +100,7 @@ body:
100100
- h2: Methods
101101
- api3: CreateCoordinate(double, double)
102102
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_CreateCoordinate_System_Double_System_Double_
103-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L224
103+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L201
104104
metadata:
105105
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double)
106106
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double)
@@ -123,54 +123,17 @@ body:
123123
- type:
124124
- TCoordinate
125125
description: A <code class="typeparamref">TCoordinate</code> instance representing the specified geographic coordinate.
126-
- api3: Decode(TPolyline)
127-
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Decode__0_
128-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L75
129-
metadata:
130-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0)
131-
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0)
132-
- markdown: Decodes an encoded <code class="typeparamref">TPolyline</code> into a sequence of <code class="typeparamref">TCoordinate</code> instances.
133-
- code: public IEnumerable<TCoordinate> Decode(TPolyline polyline)
134-
- h4: Parameters
135-
- parameters:
136-
- name: polyline
137-
type:
138-
- TPolyline
139-
description: The <code class="typeparamref">TPolyline</code> instance containing the encoded polyline string to decode.
140-
- h4: Returns
141-
- parameters:
142-
- type:
143-
- text: IEnumerable
144-
url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
145-
- <
146-
- TCoordinate
147-
- '>'
148-
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.
149-
- h4: Exceptions
150-
- parameters:
151-
- type:
152-
- text: ArgumentNullException
153-
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
154-
description: Thrown when <code class="paramref">polyline</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
155-
- type:
156-
- text: ArgumentException
157-
url: https://learn.microsoft.com/dotnet/api/system.argumentexception
158-
description: Thrown when <code class="paramref">polyline</code> is empty.
159-
- type:
160-
- text: InvalidPolylineException
161-
url: PolylineAlgorithm.Diagnostics.InvalidPolylineException.html
162-
description: Thrown when the polyline format is invalid or malformed at a specific position.
163126
- api3: Decode(TPolyline, CancellationToken)
164127
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Decode__0_System_Threading_CancellationToken_
165-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L103
128+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L80
166129
metadata:
167130
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
168131
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
169132
- markdown: >-
170133
Decodes an encoded <code class="typeparamref">TPolyline</code> into a sequence of <code class="typeparamref">TCoordinate</code> instances,
171134
172135
with support for cancellation.
173-
- code: public IEnumerable<TCoordinate> Decode(TPolyline polyline, CancellationToken cancellationToken)
136+
- code: public IEnumerable<TCoordinate> Decode(TPolyline polyline, CancellationToken cancellationToken = default)
174137
- h4: Parameters
175138
- parameters:
176139
- name: polyline
@@ -182,6 +145,7 @@ body:
182145
- text: CancellationToken
183146
url: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
184147
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
185149
- h4: Returns
186150
- parameters:
187151
- type:
@@ -203,15 +167,15 @@ body:
203167
description: Thrown when <code class="paramref">polyline</code> is empty.
204168
- type:
205169
- text: InvalidPolylineException
206-
url: PolylineAlgorithm.Diagnostics.InvalidPolylineException.html
170+
url: PolylineAlgorithm.InvalidPolylineException.html
207171
description: Thrown when the polyline format is invalid or malformed at a specific position.
208172
- type:
209173
- text: OperationCanceledException
210174
url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception
211175
description: Thrown when <code class="paramref">cancellationToken</code> is canceled during decoding.
212176
- api3: GetReadOnlyMemory(in TPolyline)
213177
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_GetReadOnlyMemory__0__
214-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L209
178+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L186
215179
metadata:
216180
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
217181
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
@@ -235,7 +199,7 @@ body:
235199
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.
236200
- api3: ValidateFormat(ReadOnlyMemory<char>, ILogger?)
237201
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_ValidateFormat_System_ReadOnlyMemory_System_Char__Microsoft_Extensions_Logging_ILogger_
238-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L189
202+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L166
239203
metadata:
240204
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)
241205
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)

api-reference/1.0/PolylineAlgorithm.Abstraction.AbstractPolylineEncoder-2.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ body:
106106
- h2: Methods
107107
- api3: CreatePolyline(ReadOnlyMemory<char>)
108108
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_CreatePolyline_System_ReadOnlyMemory_System_Char__
109-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L165
109+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L169
110110
metadata:
111111
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.CreatePolyline(System.ReadOnlyMemory{System.Char})
112112
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.CreatePolyline(System.ReadOnlyMemory{System.Char})
@@ -128,17 +128,17 @@ body:
128128
- type:
129129
- TPolyline
130130
description: An instance of <code class="typeparamref">TPolyline</code> representing the encoded polyline.
131-
- api3: Encode(ReadOnlySpan<TCoordinate>)
132-
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_Encode_System_ReadOnlySpan__0__
133-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L76
131+
- api3: Encode(ReadOnlySpan<TCoordinate>, CancellationToken)
132+
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_Encode_System_ReadOnlySpan__0__System_Threading_CancellationToken_
133+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L79
134134
metadata:
135-
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Encode(System.ReadOnlySpan{`0})
136-
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Encode(System.ReadOnlySpan{`0})
135+
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Encode(System.ReadOnlySpan{`0},System.Threading.CancellationToken)
136+
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.Encode(System.ReadOnlySpan{`0},System.Threading.CancellationToken)
137137
- markdown: Encodes a collection of <code class="typeparamref">TCoordinate</code> instances into an encoded <code class="typeparamref">TPolyline</code> string.
138138
- code: >-
139139
[SuppressMessage("Design", "MA0051:Method is too long", Justification = "Method contains local methods. Actual method only 55 lines.")]
140140
141-
public TPolyline Encode(ReadOnlySpan<TCoordinate> coordinates)
141+
public TPolyline Encode(ReadOnlySpan<TCoordinate> coordinates, CancellationToken cancellationToken = default)
142142
- h4: Parameters
143143
- parameters:
144144
- name: coordinates
@@ -149,6 +149,12 @@ body:
149149
- TCoordinate
150150
- '>'
151151
description: The collection of <code class="typeparamref">TCoordinate</code> objects to encode.
152+
- name: cancellationToken
153+
type:
154+
- text: CancellationToken
155+
url: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
156+
description: A <xref href="System.Threading.CancellationToken" data-throw-if-not-resolved="false"></xref> that can be used to cancel the encoding operation.
157+
optional: true
152158
- h4: Returns
153159
- parameters:
154160
- type:
@@ -170,7 +176,7 @@ body:
170176
description: Thrown when the internal encoding buffer cannot accommodate the encoded value.
171177
- api3: GetLatitude(TCoordinate)
172178
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_GetLatitude__0_
173-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L185
179+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L189
174180
metadata:
175181
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.GetLatitude(`0)
176182
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.GetLatitude(`0)
@@ -190,7 +196,7 @@ body:
190196
description: The latitude value as a <xref href="System.Double" data-throw-if-not-resolved="false"></xref>.
191197
- api3: GetLongitude(TCoordinate)
192198
id: PolylineAlgorithm_Abstraction_AbstractPolylineEncoder_2_GetLongitude__0_
193-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L175
199+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/AbstractPolylineEncoder.cs#L179
194200
metadata:
195201
uid: PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.GetLongitude(`0)
196202
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineEncoder`2.GetLongitude(`0)
Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
### YamlMime:ApiPage
2-
title: Interface IPolylineDecoder<TPolyline, TCoordinate>
2+
title: Interface IPolylineDecoder<TPolyline, TValue>
33
body:
4-
- api1: Interface IPolylineDecoder<TPolyline, TCoordinate>
4+
- api1: Interface IPolylineDecoder<TPolyline, TValue>
55
id: PolylineAlgorithm_Abstraction_IPolylineDecoder_2
6-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs#L13
6+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs#L22
77
metadata:
88
uid: PolylineAlgorithm.Abstraction.IPolylineDecoder`2
99
commentId: T:PolylineAlgorithm.Abstraction.IPolylineDecoder`2
@@ -15,35 +15,76 @@ body:
1515
- name: Assembly
1616
value: PolylineAlgorithm.dll
1717
- markdown: Defines a contract for decoding an encoded polyline into a sequence of geographic coordinates.
18-
- code: public interface IPolylineDecoder<TPolyline, out TCoordinate>
18+
- code: public interface IPolylineDecoder<TPolyline, out TValue>
1919
- h4: Type Parameters
2020
- parameters:
2121
- name: TPolyline
22-
- name: TCoordinate
22+
description: >-
23+
The type that represents the encoded polyline input. Common implementations use <xref href="System.String" data-throw-if-not-resolved="false"></xref>,
24+
25+
but custom wrapper types are allowed to carry additional metadata.
26+
- name: TValue
27+
description: >-
28+
The coordinate type returned by the decoder. Typical implementations return a struct or class that
29+
30+
contains latitude and longitude (for example a <code>LatLng</code> type or a <code>ValueTuple&lt;double,double&gt;</code>).
2331
- h2: Methods
24-
- api3: Decode(TPolyline)
25-
id: PolylineAlgorithm_Abstraction_IPolylineDecoder_2_Decode__0_
26-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs#L23
32+
- api3: Decode(TPolyline, CancellationToken)
33+
id: PolylineAlgorithm_Abstraction_IPolylineDecoder_2_Decode__0_System_Threading_CancellationToken_
34+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/develop/1.0/src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs#L48
2735
metadata:
28-
uid: PolylineAlgorithm.Abstraction.IPolylineDecoder`2.Decode(`0)
29-
commentId: M:PolylineAlgorithm.Abstraction.IPolylineDecoder`2.Decode(`0)
30-
- markdown: Decodes the specified encoded polyline into a sequence of geographic coordinates.
31-
- code: IEnumerable<out TCoordinate> Decode(TPolyline polyline)
36+
uid: PolylineAlgorithm.Abstraction.IPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
37+
commentId: M:PolylineAlgorithm.Abstraction.IPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
38+
- markdown: >-
39+
Decodes the specified encoded polyline into an ordered sequence of geographic coordinates.
40+
41+
The sequence preserves the original vertex order encoded by the <code class="paramref">polyline</code>.
42+
- code: IEnumerable<out TValue> Decode(TPolyline polyline, CancellationToken cancellationToken = default)
3243
- h4: Parameters
3344
- parameters:
3445
- name: polyline
3546
type:
3647
- TPolyline
37-
description: The <code class="typeparamref">TPolyline</code> instance containing the encoded polyline string to decode.
48+
description: >-
49+
The <code class="typeparamref">TPolyline</code> instance containing the encoded polyline to decode.
50+
51+
Implementations SHOULD validate the input and may throw <xref href="System.ArgumentException" data-throw-if-not-resolved="false"></xref>
52+
53+
or <xref href="System.FormatException" data-throw-if-not-resolved="false"></xref> for invalid formats.
54+
- name: cancellationToken
55+
type:
56+
- text: CancellationToken
57+
url: https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken
58+
description: >-
59+
A <xref href="System.Threading.CancellationToken" data-throw-if-not-resolved="false"></xref> to observe while decoding. If cancellation is requested,
60+
61+
implementations SHOULD stop work and throw an <xref href="System.OperationCanceledException" data-throw-if-not-resolved="false"></xref>.
62+
optional: true
3863
- h4: Returns
3964
- parameters:
4065
- type:
4166
- text: IEnumerable
4267
url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
4368
- <
44-
- TCoordinate
69+
- TValue
4570
- '>'
46-
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.
71+
description: >-
72+
An <xref href="System.Collections.Generic.IEnumerable%601" data-throw-if-not-resolved="false"></xref> of <code class="typeparamref">TValue</code> representing the decoded
73+
74+
latitude/longitude pairs (or equivalent coordinates) in the same order they were encoded.
75+
- h4: Remarks
76+
- markdown: >-
77+
Implementations commonly follow the Google Encoded Polyline Algorithm Format, but this interface
78+
79+
does not mandate a specific encoding. Consumers should rely on a concrete decoder's documentation
80+
81+
to understand the exact encoding supported.
82+
- h4: Exceptions
83+
- parameters:
84+
- type:
85+
- text: OperationCanceledException
86+
url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception
87+
description: Thrown when the provided <code class="paramref">cancellationToken</code> requests cancellation.
4788
languageId: csharp
4889
metadata:
4990
description: Defines a contract for decoding an encoded polyline into a sequence of geographic coordinates.

0 commit comments

Comments
 (0)