Skip to content

Commit 34e61c0

Browse files
author
Pete Sramek
committed
added defaults for coordinate
1 parent c1791eb commit 34e61c0

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

src/PolylineAlgorithm.Abstraction/Internal/Defaults.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,66 @@ public static class Algorithm {
4242
public const byte UnitSeparator = 31;
4343
}
4444

45+
public static class Coordinate {
46+
/// <summary>
47+
/// Provides constants representing latitude values, including the default, minimum, and maximum valid values.
48+
/// </summary>
49+
/// <remarks>Latitude values are measured in degrees and represent the angular distance north or
50+
/// south of the equator. The <see cref="Default"/> constant represents the equator, while <see cref="Min"/> and
51+
/// <see cref="Max"/> define the valid range of latitude values, corresponding to the poles.</remarks>
52+
public static class Latitude {
53+
/// <summary>
54+
/// The default value for latitude, representing the equator.
55+
/// </summary>
56+
public const double Default = 0.0;
57+
/// <summary>
58+
/// The minimum valid latitude value.
59+
/// </summary>
60+
public const double Min = -90.0;
61+
/// <summary>
62+
/// The maximum valid latitude value.
63+
/// </summary>
64+
public const double Max = 90.0;
65+
66+
public static class Normalized {
67+
/// <summary>
68+
/// The minimum normalized latitude value.
69+
/// </summary>
70+
public const int Min = (int)(Latitude.Min * Algorithm.Precision);
71+
/// <summary>
72+
/// The maximum normalized latitude value.
73+
/// </summary>
74+
public const int Max = (int)(Latitude.Max * Algorithm.Precision);
75+
}
76+
}
77+
78+
public static class Longitude {
79+
/// <summary>
80+
/// The default value for longitude, representing the equator.
81+
/// </summary>
82+
public const double Default = 0.0;
83+
/// <summary>
84+
/// The minimum valid longitude value.
85+
/// </summary>
86+
public const double Min = -180.0;
87+
/// <summary>
88+
/// The maximum valid longitude value.
89+
/// </summary>
90+
public const double Max = 180.0;
91+
92+
public static class Normalized {
93+
/// <summary>
94+
/// The minimum normalized latitude value.
95+
/// </summary>
96+
public const int Min = (int)(Longitude.Min * Algorithm.Precision);
97+
/// <summary>
98+
/// The maximum normalized latitude value.
99+
/// </summary>
100+
public const int Max = (int)(Longitude.Max * Algorithm.Precision);
101+
}
102+
}
103+
}
104+
45105
/// <summary>
46106
/// Contains default values and constants related to polyline encoding.
47107
/// </summary>

0 commit comments

Comments
 (0)