We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44a16af commit 11cea37Copy full SHA for 11cea37
1 file changed
src/PolylineAlgorithm/PolylineDecoder.cs
@@ -42,6 +42,14 @@ public PolylineDecoder(PolylineEncodingOptions<Coordinate> options) {
42
/// <returns>A <see cref="Coordinate"/> instance.</returns>
43
[MethodImpl(MethodImplOptions.AggressiveInlining)]
44
protected override Coordinate CreateCoordinate(double latitude, double longitude) {
45
+ if (!Options.Validator.IsValidLatitude(latitude)) {
46
+ throw new ArgumentOutOfRangeException(nameof(latitude), latitude, "Latitude must be between -90 and 90 degrees.");
47
+ }
48
+
49
+ if (!Options.Validator.IsValidLongitude(longitude)) {
50
+ throw new ArgumentOutOfRangeException(nameof(longitude), longitude, "Longitude must be between -180 and 180 degrees.");
51
52
53
return new Coordinate(latitude, longitude);
54
}
55
0 commit comments