Skip to content

Commit 5dffb17

Browse files
committed
Merge branch 'extend-polylinealgorithm-multi-dimensional-support' of https://github.com/petesramek/polyline-algorithm-csharp into extend-polylinealgorithm-multi-dimensional-support
2 parents 454588d + 18948f4 commit 5dffb17

4 files changed

Lines changed: 53 additions & 43 deletions

api-reference/0.0/PolylineAlgorithm.Abstraction.IPolylineEncoder-2.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Interface IPolylineEncoder<TValue, TPolyline>
33
body:
44
- api1: Interface IPolylineEncoder<TValue, TPolyline>
55
id: PolylineAlgorithm_Abstraction_IPolylineEncoder_2
6-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs#L36
6+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs#L38
77
metadata:
88
uid: PolylineAlgorithm.Abstraction.IPolylineEncoder`2
99
commentId: T:PolylineAlgorithm.Abstraction.IPolylineEncoder`2
@@ -56,35 +56,35 @@ body:
5656
- Value precision and rounding rules (for example 1e-5 for 5-decimal precision).
5757
- Value ordering and whether altitude or additional dimensions are supported.
5858
- Thread-safety guarantees: whether instances are safe to reuse concurrently or must be instantiated per-call.
59-
- Implementations are encouraged to be memory-efficient; the API accepts a <xref href="System.ReadOnlySpan%601" data-throw-if-not-resolved="false"></xref>
60-
to avoid forced allocations when callers already have contiguous memory.
6159
- h2: Methods
62-
- api3: Encode(ReadOnlySpan<TValue>, PolylineEncodingOptions<TValue>?, CancellationToken)
63-
id: PolylineAlgorithm_Abstraction_IPolylineEncoder_2_Encode_System_ReadOnlySpan__0__PolylineAlgorithm_PolylineEncodingOptions__0__System_Threading_CancellationToken_
64-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs#L76
60+
- api3: Encode(IEnumerable<TValue>, PolylineEncodingOptions<TValue>?, CancellationToken)
61+
id: PolylineAlgorithm_Abstraction_IPolylineEncoder_2_Encode_System_Collections_Generic_IEnumerable__0__PolylineAlgorithm_PolylineEncodingOptions__0__System_Threading_CancellationToken_
62+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs#L82
6563
metadata:
66-
uid: PolylineAlgorithm.Abstraction.IPolylineEncoder`2.Encode(System.ReadOnlySpan{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
67-
commentId: M:PolylineAlgorithm.Abstraction.IPolylineEncoder`2.Encode(System.ReadOnlySpan{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
64+
uid: PolylineAlgorithm.Abstraction.IPolylineEncoder`2.Encode(System.Collections.Generic.IEnumerable{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
65+
commentId: M:PolylineAlgorithm.Abstraction.IPolylineEncoder`2.Encode(System.Collections.Generic.IEnumerable{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
6866
- markdown: >-
6967
Encodes a sequence of values into an encoded polyline representation.
7068
7169
The order of values in <code class="paramref">coordinates</code> is preserved in the encoded result.
72-
- code: TPolyline Encode(ReadOnlySpan<TValue> coordinates, PolylineEncodingOptions<TValue>? options = null, CancellationToken cancellationToken = default)
70+
- code: TPolyline Encode(IEnumerable<TValue> coordinates, PolylineEncodingOptions<TValue>? options = null, CancellationToken cancellationToken = default)
7371
- h4: Parameters
7472
- parameters:
7573
- name: coordinates
7674
type:
77-
- text: ReadOnlySpan
78-
url: https://learn.microsoft.com/dotnet/api/system.readonlyspan-1
75+
- text: IEnumerable
76+
url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
7977
- <
8078
- TValue
8179
- '>'
8280
description: >-
83-
The collection of <code class="typeparamref">TValue</code> instances to encode into a polyline.
81+
The sequence of <code class="typeparamref">TValue</code> instances to encode into a polyline.
8482
85-
The span may be empty; implementations should return an appropriate empty encoded representation
83+
The sequence may be empty; implementations should return an appropriate empty encoded representation
8684
8785
(for example an empty string or an empty memory slice) rather than <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
86+
87+
Must not be <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
8888
- name: options
8989
type:
9090
- text: PolylineEncodingOptions
@@ -135,6 +135,10 @@ body:
135135
variants can still implement this interface by materializing the final encoded result.
136136
- h4: Exceptions
137137
- parameters:
138+
- type:
139+
- text: ArgumentNullException
140+
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
141+
description: Thrown if <code class="paramref">coordinates</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
138142
- type:
139143
- text: OperationCanceledException
140144
url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception

api-reference/0.0/PolylineAlgorithm.Extensions.PolylineEncoderExtensions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Class PolylineEncoderExtensions
33
body:
44
- api1: Class PolylineEncoderExtensions
55
id: PolylineAlgorithm_Extensions_PolylineEncoderExtensions
6-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs#L15
6+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs#L16
77
metadata:
88
uid: PolylineAlgorithm.Extensions.PolylineEncoderExtensions
99
commentId: T:PolylineAlgorithm.Extensions.PolylineEncoderExtensions
@@ -41,7 +41,7 @@ body:
4141
- h2: Methods
4242
- api3: Encode<TValue, TPolyline>(IPolylineEncoder<TValue, TPolyline>, TValue[], PolylineEncodingOptions<TValue>?, CancellationToken)
4343
id: PolylineAlgorithm_Extensions_PolylineEncoderExtensions_Encode__2_PolylineAlgorithm_Abstraction_IPolylineEncoder___0___1____0___PolylineAlgorithm_PolylineEncodingOptions___0__System_Threading_CancellationToken_
44-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs#L33
44+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs#L34
4545
metadata:
4646
uid: PolylineAlgorithm.Extensions.PolylineEncoderExtensions.Encode``2(PolylineAlgorithm.Abstraction.IPolylineEncoder{``0,``1},``0[],PolylineAlgorithm.PolylineEncodingOptions{``0},System.Threading.CancellationToken)
4747
commentId: M:PolylineAlgorithm.Extensions.PolylineEncoderExtensions.Encode``2(PolylineAlgorithm.Abstraction.IPolylineEncoder{``0,``1},``0[],PolylineAlgorithm.PolylineEncodingOptions{``0},System.Threading.CancellationToken)

api-reference/0.0/PolylineAlgorithm.PolylineEncoder-2.yml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Class PolylineEncoder<TValue, TPolyline>
33
body:
44
- api1: Class PolylineEncoder<TValue, TPolyline>
55
id: PolylineAlgorithm_PolylineEncoder_2
6-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L28
6+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L26
77
metadata:
88
uid: PolylineAlgorithm.PolylineEncoder`2
99
commentId: T:PolylineAlgorithm.PolylineEncoder`2
@@ -62,7 +62,7 @@ body:
6262
- h2: Constructors
6363
- api3: PolylineEncoder(PolylineOptions<TValue, TPolyline>)
6464
id: PolylineAlgorithm_PolylineEncoder_2__ctor_PolylineAlgorithm_PolylineOptions__0__1__
65-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L43
65+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L41
6666
metadata:
6767
uid: PolylineAlgorithm.PolylineEncoder`2.#ctor(PolylineAlgorithm.PolylineOptions{`0,`1})
6868
commentId: M:PolylineAlgorithm.PolylineEncoder`2.#ctor(PolylineAlgorithm.PolylineOptions{`0,`1})
@@ -94,23 +94,26 @@ body:
9494
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
9595
description: Thrown when <code class="paramref">options</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
9696
- h2: Methods
97-
- api3: Encode(ReadOnlySpan<TValue>, CancellationToken)
98-
id: PolylineAlgorithm_PolylineEncoder_2_Encode_System_ReadOnlySpan__0__System_Threading_CancellationToken_
99-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L72
97+
- api3: Encode(IEnumerable<TValue>, CancellationToken)
98+
id: PolylineAlgorithm_PolylineEncoder_2_Encode_System_Collections_Generic_IEnumerable__0__System_Threading_CancellationToken_
99+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L70
100100
metadata:
101-
uid: PolylineAlgorithm.PolylineEncoder`2.Encode(System.ReadOnlySpan{`0},System.Threading.CancellationToken)
102-
commentId: M:PolylineAlgorithm.PolylineEncoder`2.Encode(System.ReadOnlySpan{`0},System.Threading.CancellationToken)
101+
uid: PolylineAlgorithm.PolylineEncoder`2.Encode(System.Collections.Generic.IEnumerable{`0},System.Threading.CancellationToken)
102+
commentId: M:PolylineAlgorithm.PolylineEncoder`2.Encode(System.Collections.Generic.IEnumerable{`0},System.Threading.CancellationToken)
103103
- markdown: >-
104104
Encodes a collection of <code class="typeparamref">TValue</code> instances into an encoded
105105
106106
<code class="typeparamref">TPolyline</code>.
107-
- code: public TPolyline Encode(ReadOnlySpan<TValue> coordinates, CancellationToken cancellationToken = default)
107+
- code: >-
108+
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Null is verified before use via ExceptionGuard.ThrowArgumentNull, which is annotated [DoesNotReturn]. CA1062 does not recognise custom [DoesNotReturn] helpers as null guards.")]
109+
110+
public TPolyline Encode(IEnumerable<TValue> coordinates, CancellationToken cancellationToken = default)
108111
- h4: Parameters
109112
- parameters:
110113
- name: coordinates
111114
type:
112-
- text: ReadOnlySpan
113-
url: https://learn.microsoft.com/dotnet/api/system.readonlyspan-1
115+
- text: IEnumerable
116+
url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
114117
- <
115118
- TValue
116119
- '>'
@@ -128,24 +131,24 @@ body:
128131
description: An instance of <code class="typeparamref">TPolyline</code> representing the encoded values.
129132
- h4: Exceptions
130133
- parameters:
134+
- type:
135+
- text: ArgumentNullException
136+
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
137+
description: Thrown when <code class="paramref">coordinates</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
131138
- type:
132139
- text: ArgumentException
133140
url: https://learn.microsoft.com/dotnet/api/system.argumentexception
134141
description: Thrown when <code class="paramref">coordinates</code> is empty.
135-
- type:
136-
- text: InvalidOperationException
137-
url: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
138-
description: Thrown when the internal encoding buffer cannot accommodate the encoded value.
139142
- type:
140143
- text: OperationCanceledException
141144
url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception
142145
description: Thrown when <code class="paramref">cancellationToken</code> is canceled.
143-
- api3: Encode(ReadOnlySpan<TValue>, PolylineEncodingOptions<TValue>?, CancellationToken)
144-
id: PolylineAlgorithm_PolylineEncoder_2_Encode_System_ReadOnlySpan__0__PolylineAlgorithm_PolylineEncodingOptions__0__System_Threading_CancellationToken_
145-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L158
146+
- api3: Encode(IEnumerable<TValue>, PolylineEncodingOptions<TValue>?, CancellationToken)
147+
id: PolylineAlgorithm_PolylineEncoder_2_Encode_System_Collections_Generic_IEnumerable__0__PolylineAlgorithm_PolylineEncodingOptions__0__System_Threading_CancellationToken_
148+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/PolylineEncoder.cs#L107
146149
metadata:
147-
uid: PolylineAlgorithm.PolylineEncoder`2.Encode(System.ReadOnlySpan{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
148-
commentId: M:PolylineAlgorithm.PolylineEncoder`2.Encode(System.ReadOnlySpan{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
150+
uid: PolylineAlgorithm.PolylineEncoder`2.Encode(System.Collections.Generic.IEnumerable{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
151+
commentId: M:PolylineAlgorithm.PolylineEncoder`2.Encode(System.Collections.Generic.IEnumerable{`0},PolylineAlgorithm.PolylineEncodingOptions{`0},System.Threading.CancellationToken)
149152
- markdown: >-
150153
Encodes a collection of <code class="typeparamref">TValue</code> instances into an encoded
151154
@@ -154,13 +157,16 @@ body:
154157
delta baseline. Use this overload to encode large sequences in independent chunks that can be
155158
156159
concatenated into a single valid polyline.
157-
- code: public TPolyline Encode(ReadOnlySpan<TValue> coordinates, PolylineEncodingOptions<TValue>? options, CancellationToken cancellationToken)
160+
- code: >-
161+
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Null is verified before use via ExceptionGuard.ThrowArgumentNull, which is annotated [DoesNotReturn]. CA1062 does not recognise custom [DoesNotReturn] helpers as null guards.")]
162+
163+
public TPolyline Encode(IEnumerable<TValue> coordinates, PolylineEncodingOptions<TValue>? options, CancellationToken cancellationToken)
158164
- h4: Parameters
159165
- parameters:
160166
- name: coordinates
161167
type:
162-
- text: ReadOnlySpan
163-
url: https://learn.microsoft.com/dotnet/api/system.readonlyspan-1
168+
- text: IEnumerable
169+
url: https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1
164170
- <
165171
- TValue
166172
- '>'
@@ -180,7 +186,7 @@ body:
180186
181187
<a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> to use the formatter's default baseline (same as calling
182188
183-
<xref href="PolylineAlgorithm.PolylineEncoder%602.Encode(System.ReadOnlySpan%7b%600%7d%2cSystem.Threading.CancellationToken)" data-throw-if-not-resolved="false"></xref>).
189+
<xref href="PolylineAlgorithm.PolylineEncoder%602.Encode(System.Collections.Generic.IEnumerable%7b%600%7d%2cSystem.Threading.CancellationToken)" data-throw-if-not-resolved="false"></xref>).
184190
- name: cancellationToken
185191
type:
186192
- text: CancellationToken
@@ -193,14 +199,14 @@ body:
193199
description: An instance of <code class="typeparamref">TPolyline</code> representing the encoded values.
194200
- h4: Exceptions
195201
- parameters:
202+
- type:
203+
- text: ArgumentNullException
204+
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
205+
description: Thrown when <code class="paramref">coordinates</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
196206
- type:
197207
- text: ArgumentException
198208
url: https://learn.microsoft.com/dotnet/api/system.argumentexception
199209
description: Thrown when <code class="paramref">coordinates</code> is empty.
200-
- type:
201-
- text: InvalidOperationException
202-
url: https://learn.microsoft.com/dotnet/api/system.invalidoperationexception
203-
description: Thrown when the internal encoding buffer cannot accommodate the encoded value.
204210
- type:
205211
- text: OperationCanceledException
206212
url: https://learn.microsoft.com/dotnet/api/system.operationcanceledexception

api-reference/0.0/PolylineAlgorithm.PolylineEncodingOptions-1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ body:
4444
- markdown: >-
4545
Pass an instance of this class to the chunked
4646
47-
<xref href="PolylineAlgorithm.Abstraction.IPolylineEncoder%602.Encode(System.ReadOnlySpan%7b%600%7d%2cPolylineAlgorithm.PolylineEncodingOptions%7b%600%7d%2cSystem.Threading.CancellationToken)" data-throw-if-not-resolved="false"></xref> overload to control
47+
<xref href="PolylineAlgorithm.Abstraction.IPolylineEncoder%602.Encode(System.Collections.Generic.IEnumerable%7b%600%7d%2cPolylineAlgorithm.PolylineEncodingOptions%7b%600%7d%2cSystem.Threading.CancellationToken)" data-throw-if-not-resolved="false"></xref> overload to control
4848
4949
the delta baseline used at the start of each chunk. When <xref href="PolylineAlgorithm.PolylineEncodingOptions%601.HasPrevious" data-throw-if-not-resolved="false"></xref> is
5050

0 commit comments

Comments
 (0)