Skip to content

Commit acb892a

Browse files
Copilotpetesramek
andauthored
chore: update XML doc comments to replace coordinate with value
Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/a91e90b4-cfd4-4daa-8202-ce52524fb335 Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
1 parent b895ea5 commit acb892a

16 files changed

Lines changed: 62 additions & 62 deletions

src/PolylineAlgorithm/Abstraction/IPolylineDecoder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ namespace PolylineAlgorithm.Abstraction;
99
using System.Threading;
1010

1111
/// <summary>
12-
/// Defines a contract for decoding an encoded polyline into a sequence of geographic coordinates.
12+
/// Defines a contract for decoding an encoded polyline into a sequence of values.
1313
/// </summary>
1414
/// <typeparam name="TPolyline">
1515
/// The type that represents the encoded polyline input. Common implementations use <see cref="string"/>,
1616
/// but custom wrapper types are allowed to carry additional metadata.
1717
/// </typeparam>
1818
/// <typeparam name="TValue">
19-
/// The coordinate type returned by the decoder. Typical implementations return a struct or class that
19+
/// The value type returned by the decoder. Typical implementations return a struct or class that
2020
/// contains latitude and longitude (for example a <c>LatLng</c> type or a <c>ValueTuple&lt;double,double&gt;</c>).
2121
/// </typeparam>
2222
public interface IPolylineDecoder<TPolyline, TValue> {
2323
/// <summary>
24-
/// Decodes the specified encoded polyline into an ordered sequence of geographic coordinates.
24+
/// Decodes the specified encoded polyline into an ordered sequence of values.
2525
/// The sequence preserves the original vertex order encoded by the <paramref name="polyline"/>.
2626
/// </summary>
2727
/// <param name="polyline">
@@ -35,7 +35,7 @@ public interface IPolylineDecoder<TPolyline, TValue> {
3535
/// </param>
3636
/// <returns>
3737
/// An <see cref="IEnumerable{T}"/> of <typeparamref name="TValue"/> representing the decoded
38-
/// latitude/longitude pairs (or equivalent coordinates) in the same order they were encoded.
38+
/// latitude/longitude pairs (or equivalent values) in the same order they were encoded.
3939
/// </returns>
4040
/// <remarks>
4141
/// Implementations commonly follow the Google Encoded Polyline Algorithm Format, but this interface

src/PolylineAlgorithm/Abstraction/IPolylineEncoder.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
namespace PolylineAlgorithm.Abstraction;
77
/// <summary>
8-
/// Contract for encoding a sequence of geographic coordinates into an encoded polyline representation.
8+
/// Contract for encoding a sequence of values into an encoded polyline representation.
99
/// Implementations interpret the generic <typeparamref name="TValue"/> type and produce an encoded
10-
/// representation of those coordinates as <typeparamref name="TPolyline"/>.
10+
/// representation of those values as <typeparamref name="TPolyline"/>.
1111
/// </summary>
1212
/// <typeparam name="TValue">
13-
/// The concrete coordinate representation used by the encoder (for example a struct or class containing
13+
/// The concrete value representation used by the encoder (for example a struct or class containing
1414
/// <c>Latitude</c> and <c>Longitude</c> values). Implementations must document the expected shape,
1515
/// units (typically decimal degrees), and any required fields for <typeparamref name="TValue"/>.
1616
/// Common shapes:
@@ -27,16 +27,16 @@ namespace PolylineAlgorithm.Abstraction;
2727
/// - This interface is intentionally minimal to allow different encoding strategies (Google encoded polyline,
2828
/// precision/scale variants, or custom compressed formats) to be expressed behind a common contract.
2929
/// - Implementations should document:
30-
/// - Coordinate precision and rounding rules (for example 1e-5 for 5-decimal precision).
31-
/// - Coordinate ordering and whether altitude or additional dimensions are supported.
30+
/// - Value precision and rounding rules (for example 1e-5 for 5-decimal precision).
31+
/// - Value ordering and whether altitude or additional dimensions are supported.
3232
/// - Thread-safety guarantees: whether instances are safe to reuse concurrently or must be instantiated per-call.
3333
/// - Implementations are encouraged to be memory-efficient; the API accepts a <see cref="ReadOnlySpan{T}"/>
3434
/// to avoid forced allocations when callers already have contiguous memory.
3535
/// </remarks>
3636
public interface IPolylineEncoder<TValue, TPolyline> {
3737
/// <summary>
38-
/// Encodes a sequence of geographic coordinates into an encoded polyline representation.
39-
/// The order of coordinates in <paramref name="coordinates"/> is preserved in the encoded result.
38+
/// Encodes a sequence of values into an encoded polyline representation.
39+
/// The order of values in <paramref name="coordinates"/> is preserved in the encoded result.
4040
/// </summary>
4141
/// <param name="coordinates">
4242
/// The collection of <typeparamref name="TValue"/> instances to encode into a polyline.
@@ -49,24 +49,24 @@ public interface IPolylineEncoder<TValue, TPolyline> {
4949
/// when cancellation is requested. For fast, in-memory encoders cancellation may be best-effort.
5050
/// </param>
5151
/// <returns>
52-
/// A <typeparamref name="TPolyline"/> containing the encoded polyline that represents the input coordinates.
52+
/// A <typeparamref name="TPolyline"/> containing the encoded polyline that represents the input values.
5353
/// The exact format and any delimiting/terminating characters are implementation-specific and must be
5454
/// documented by concrete encoder types.
5555
/// </returns>
5656
/// <example>
5757
/// <code>
5858
/// // Example pseudocode for typical usage with a string-based encoder:
59-
/// var coords = new[] {
60-
/// new Coordinate { Latitude = 47.6219, Longitude = -122.3503 },
61-
/// new Coordinate { Latitude = 47.6220, Longitude = -122.3504 }
59+
/// var values = new[] {
60+
/// new Value { Latitude = 47.6219, Longitude = -122.3503 },
61+
/// new Value { Latitude = 47.6220, Longitude = -122.3504 }
6262
/// };
63-
/// IPolylineEncoder&lt;Coordinate,string&gt; encoder = new GoogleEncodedPolylineEncoder();
64-
/// string encoded = encoder.Encode(coords, CancellationToken.None);
63+
/// IPolylineEncoder&lt;Value,string&gt; encoder = new GoogleEncodedPolylineEncoder();
64+
/// string encoded = encoder.Encode(values, CancellationToken.None);
6565
/// </code>
6666
/// </example>
6767
/// <remarks>
6868
/// - Implementations should validate input as appropriate and document any preconditions (for example
69-
/// if coordinates must be within [-90,90] latitude and [-180,180] longitude).
69+
/// if values must be within [-90,90] latitude and [-180,180] longitude).
7070
/// - For large input sequences, implementations may provide streaming or incremental encoders; those
7171
/// variants can still implement this interface by materializing the final encoded result.
7272
/// </remarks>

src/PolylineAlgorithm/Abstraction/IPolylineFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace PolylineAlgorithm.Abstraction;
1313
/// produce a <typeparamref name="TPolyline"/> from an encoded character buffer, and extract that buffer
1414
/// back from a <typeparamref name="TPolyline"/>.
1515
/// </summary>
16-
/// <typeparam name="TValue">The coordinate or item type. For example a struct with Latitude/Longitude.</typeparam>
16+
/// <typeparam name="TValue">The value or item type. For example a struct with Latitude/Longitude.</typeparam>
1717
/// <typeparam name="TPolyline">The polyline surface type. For example <see cref="string"/> or
1818
/// <see cref="ReadOnlyMemory{T}"/> of <see cref="char"/>.</typeparam>
1919
/// <remarks>

src/PolylineAlgorithm/Extensions/PolylineEncoderExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ namespace PolylineAlgorithm.Extensions;
1010
using System;
1111

1212
/// <summary>
13-
/// Provides extension methods for the <see cref="IPolylineEncoder{TValue, TPolyline}"/> interface to facilitate encoding geographic coordinates into polylines.
13+
/// Provides extension methods for the <see cref="IPolylineEncoder{TValue, TPolyline}"/> interface to facilitate encoding values into polylines.
1414
/// </summary>
1515
public static class PolylineEncoderExtensions {
1616
/// <summary>
1717
/// Encodes an array of <typeparamref name="TValue"/> instances into an encoded polyline.
1818
/// </summary>
19-
/// <typeparam name="TValue">The type that represents a geographic coordinate to encode.</typeparam>
19+
/// <typeparam name="TValue">The type that represents a value to encode.</typeparam>
2020
/// <typeparam name="TPolyline">The type that represents the encoded polyline output.</typeparam>
2121
/// <param name="encoder">
2222
/// The <see cref="IPolylineEncoder{TValue, TPolyline}"/> instance used to perform the encoding operation.
@@ -25,7 +25,7 @@ public static class PolylineEncoderExtensions {
2525
/// The array of <typeparamref name="TValue"/> objects to encode.
2626
/// </param>
2727
/// <returns>
28-
/// A <typeparamref name="TPolyline"/> instance representing the encoded polyline for the provided coordinates.
28+
/// A <typeparamref name="TPolyline"/> instance representing the encoded polyline for the provided values.
2929
/// </returns>
3030
/// <exception cref="ArgumentNullException">
3131
/// Thrown when <paramref name="encoder"/> or <paramref name="values"/> is <see langword="null"/>.

src/PolylineAlgorithm/FormatterBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace PolylineAlgorithm;
1212
/// <summary>
1313
/// Provides a fluent builder for constructing a <see cref="PolylineFormatter{TValue, TPolyline}"/>.
1414
/// </summary>
15-
/// <typeparam name="TValue">The coordinate or item type from which column values are extracted.</typeparam>
15+
/// <typeparam name="TValue">The value or item type from which column values are extracted.</typeparam>
1616
/// <typeparam name="TPolyline">The polyline surface type produced and consumed by the formatter.</typeparam>
1717
/// <remarks>
1818
/// <para>

src/PolylineAlgorithm/Internal/Defaults.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace PolylineAlgorithm.Internal;
1111
/// Provides default values and constants used throughout the Polyline Algorithm.
1212
/// </summary>
1313
/// <remarks>
14-
/// Organizes defaults for algorithm parameters, polyline encoding, and geographic coordinates into nested static classes.
14+
/// Organizes defaults for algorithm parameters, polyline encoding, and geographic values into nested static classes.
1515
/// </remarks>
1616
[ExcludeFromCodeCoverage]
1717
internal static class Defaults {
@@ -51,7 +51,7 @@ internal static class Algorithm {
5151
}
5252

5353
/// <summary>
54-
/// Contains default values and constants for geographic coordinate validation.
54+
/// Contains default values and constants for geographic value validation.
5555
/// </summary>
5656
internal static class Coordinate {
5757
/// <summary>

src/PolylineAlgorithm/Internal/Diagnostics/ExceptionGuard.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ internal static void ThrowBufferOverflow(string message) {
7070
}
7171

7272
/// <summary>
73-
/// Throws an <see cref="ArgumentOutOfRangeException"/> when a coordinate value is outside the allowed range.
73+
/// Throws an <see cref="ArgumentOutOfRangeException"/> when a value is outside the allowed range.
7474
/// </summary>
75-
/// <param name="value">The coordinate value that was out of range.</param>
75+
/// <param name="value">The value that was out of range.</param>
7676
/// <param name="min">Inclusive minimum allowed value.</param>
7777
/// <param name="max">Inclusive maximum allowed value.</param>
78-
/// <param name="paramName">Name of the parameter containing the coordinate.</param>
78+
/// <param name="paramName">Name of the parameter containing the value.</param>
7979
#if NET6_0_OR_GREATER
8080
[StackTraceHidden]
8181
#else
@@ -269,7 +269,7 @@ internal static string FormatMalformedPolyline(long position) =>
269269
string.Format(CultureInfo.InvariantCulture, PolylineIsMalformedAtFormat, position);
270270

271271
/// <summary>
272-
/// Formats a message indicating a coordinate parameter must be within a range.
272+
/// Formats a message indicating a value parameter must be within a range.
273273
/// </summary>
274274
internal static string FormatCoordinateValueMustBeBetween(string name, double min, double max) =>
275275
string.Format(CultureInfo.InvariantCulture, CoordinateValueMustBeBetweenFormat, name, min, max);

src/PolylineAlgorithm/Internal/Diagnostics/LogDebugExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ internal static partial class LogDebugExtensions {
4646
internal static partial void LogOperationFinishedDebug(this ILogger logger, string operationName);
4747

4848
/// <summary>
49-
/// Logs a debug message containing the decoded coordinate values and position.
49+
/// Logs a debug message containing the decoded values and position.
5050
/// </summary>
5151
/// <param name="logger">The <see cref="ILogger"/> used to write the log entry.</param>
5252
/// <param name="latitude">The decoded latitude value.</param>
5353
/// <param name="longitude">The decoded longitude value.</param>
54-
/// <param name="position">The position in the polyline buffer at which the coordinate was decoded.</param>
54+
/// <param name="position">The position in the polyline buffer at which the value was decoded.</param>
5555
[LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Decoded coordinate: (Latitude: {latitude}, Longitude: {longitude}) at position {position}.")]
5656
internal static partial void LogDecodedCoordinateDebug(this ILogger logger, double latitude, double longitude, int position);
5757
}

src/PolylineAlgorithm/Internal/Diagnostics/LogWarningExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ internal static partial class LogWarningExtensions {
6060
/// </summary>
6161
/// <param name="logger">The <see cref="ILogger"/> used to write the log entry.</param>
6262
/// <param name="position">The buffer position where the write was attempted.</param>
63-
/// <param name="coordinateIndex">The index of the current coordinate that prevented the write.</param>
64-
[LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Cannot write to internal buffer at position {position}. Current coordinate is at index {coordinateIndex}.")]
65-
internal static partial void LogCannotWriteValueToBufferWarning(this ILogger logger, int position, int coordinateIndex);
63+
/// <param name="valueIndex">The index of the current value that prevented the write.</param>
64+
[LoggerMessage(EVENT_ID_BASE + 4, LOG_LEVEL, "Cannot write to internal buffer at position {position}. Current value is at index {valueIndex}.")]
65+
internal static partial void LogCannotWriteValueToBufferWarning(this ILogger logger, int position, int valueIndex);
6666

6767
/// <summary>
6868
/// Logs a warning when a polyline is shorter than the minimal required length.

src/PolylineAlgorithm/PolylineDecoder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ namespace PolylineAlgorithm;
1515
using System.Threading;
1616

1717
/// <summary>
18-
/// Decodes encoded polyline representations into sequences of geographic coordinates.
18+
/// Decodes encoded polyline representations into sequences of values.
1919
/// </summary>
2020
/// <typeparam name="TPolyline">The type that represents the encoded polyline input.</typeparam>
21-
/// <typeparam name="TValue">The type that represents a decoded geographic coordinate.</typeparam>
21+
/// <typeparam name="TValue">The type that represents a decoded value.</typeparam>
2222
/// <remarks>
2323
/// Pass a <see cref="PolylineOptions{TValue, TPolyline}"/> that carries a
2424
/// <see cref="IPolylineFormatter{TValue, TPolyline}"/> to the constructor. The formatter handles
@@ -64,7 +64,7 @@ public PolylineDecoder(PolylineOptions<TValue, TPolyline> options) {
6464
/// <param name="cancellationToken">A token that can be used to cancel the operation.</param>
6565
/// <returns>
6666
/// An <see cref="IEnumerable{T}"/> of <typeparamref name="TValue"/> representing the decoded
67-
/// coordinates.
67+
/// values.
6868
/// </returns>
6969
/// <exception cref="ArgumentNullException">
7070
/// Thrown when <paramref name="polyline"/> is <see langword="null"/>.

0 commit comments

Comments
 (0)