Skip to content

Commit

Permalink
Removing validation that was put in for lat/long against the specs
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-lethargic committed Sep 28, 2018
1 parent 0d6e34b commit 446154f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/GeoJSON.Net/Geometry/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ public class Position : IPosition, IEqualityComparer<Position>, IEquatable<Posit
/// <param name="altitude">The altitude in m(eter).</param>
public Position(double latitude, double longitude, double? altitude = null)
{
if (Math.Abs(latitude) > 90)
{
throw new ArgumentOutOfRangeException(nameof(latitude), "Latitude must be a proper lat (+/- double) value between -90 and 90.");
}

if (Math.Abs(longitude) > 180)
{
throw new ArgumentOutOfRangeException(nameof(longitude), "Longitude must be a proper lon (+/- double) value between -180 and 180.");
}
// Yes I hate commented out code to, but this needs to go right now
//if (Math.Abs(latitude) > 90)
//{
// throw new ArgumentOutOfRangeException(nameof(latitude), "Latitude must be a proper lat (+/- double) value between -90 and 90.");
//}

//if (Math.Abs(longitude) > 180)
//{
// throw new ArgumentOutOfRangeException(nameof(longitude), "Longitude must be a proper lon (+/- double) value between -180 and 180.");
//}

Latitude = latitude;
Longitude = longitude;
Expand Down

1 comment on commit 446154f

@DanFTRX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for removing this but leaving the ones in the string parsing constructor?

Please sign in to comment.