@@ -17,22 +17,12 @@ public class Position : IPosition, IEqualityComparer<Position>, IEquatable<Posit
1717 /// <summary>
1818 /// Initializes a new instance of the <see cref="Position" /> class.
1919 /// </summary>
20- /// <param name="latitude">The latitude.</param>
21- /// <param name="longitude">The longitude.</param>
20+ /// <param name="latitude">The latitude, or Y coordinate .</param>
21+ /// <param name="longitude">The longitude or X coordinate .</param>
2222 /// <param name="altitude">The altitude in m(eter).</param>
2323 public Position ( double latitude , double longitude , double ? altitude = null )
2424 {
25- // Yes I hate commented out code to, but this needs to go right now
26- //if (Math.Abs(latitude) > 90)
27- //{
28- // throw new ArgumentOutOfRangeException(nameof(latitude), "Latitude must be a proper lat (+/- double) value between -90 and 90.");
29- //}
30-
31- //if (Math.Abs(longitude) > 180)
32- //{
33- // throw new ArgumentOutOfRangeException(nameof(longitude), "Longitude must be a proper lon (+/- double) value between -180 and 180.");
34- //}
35-
25+ // TODO Coordinate range validation should be performed only when CRS is supplied
3626 Latitude = latitude ;
3727 Longitude = longitude ;
3828 Altitude = altitude ;
@@ -41,11 +31,12 @@ public Position(double latitude, double longitude, double? altitude = null)
4131 /// <summary>
4232 /// Initializes a new instance of the <see cref="Position" /> class.
4333 /// </summary>
44- /// <param name="latitude">The latitude, e.g. '38.889722'.</param>
45- /// <param name="longitude">The longitude, e.g. '-77.008889'.</param>
34+ /// <param name="latitude">The latitude, or Y coordinate e.g. '38.889722'.</param>
35+ /// <param name="longitude">The longitude, or X coordinate e.g. '-77.008889'.</param>
4636 /// <param name="altitude">The altitude in m(eters).</param>
4737 public Position ( string latitude , string longitude , string altitude = null )
4838 {
39+ // TODO Coordinate range validation should be performed only when CRS is supplied
4940 if ( string . IsNullOrEmpty ( latitude ) )
5041 {
5142 throw new ArgumentOutOfRangeException ( nameof ( latitude ) , "May not be empty." ) ;
@@ -56,14 +47,14 @@ public Position(string latitude, string longitude, string altitude = null)
5647 throw new ArgumentOutOfRangeException ( nameof ( longitude ) , "May not be empty." ) ;
5748 }
5849
59- if ( ! double . TryParse ( latitude , NumberStyles . Float , CultureInfo . InvariantCulture , out double lat ) || Math . Abs ( lat ) > 90 )
50+ if ( ! double . TryParse ( latitude , NumberStyles . Float , CultureInfo . InvariantCulture , out double lat ) )
6051 {
61- throw new ArgumentOutOfRangeException ( nameof ( latitude ) , "Latitude must be a proper lat (+/- double) value between -90 and 90 ." ) ;
52+ throw new ArgumentOutOfRangeException ( nameof ( altitude ) , "Latitude representation must be a numeric ." ) ;
6253 }
6354
64- if ( ! double . TryParse ( longitude , NumberStyles . Float , CultureInfo . InvariantCulture , out double lon ) || Math . Abs ( lon ) > 180 )
55+ if ( ! double . TryParse ( longitude , NumberStyles . Float , CultureInfo . InvariantCulture , out double lon ) )
6556 {
66- throw new ArgumentOutOfRangeException ( nameof ( longitude ) , "Longitude must be a proper lon (+/- double) value between -180 and 180 ." ) ;
57+ throw new ArgumentOutOfRangeException ( nameof ( altitude ) , "Longitude representation must be a numeric ." ) ;
6758 }
6859
6960 Latitude = lat ;
@@ -86,12 +77,12 @@ public Position(string latitude, string longitude, string altitude = null)
8677 public double ? Altitude { get ; }
8778
8879 /// <summary>
89- /// Gets the latitude.
80+ /// Gets the latitude or Y coordinate
9081 /// </summary>
9182 public double Latitude { get ; }
9283
9384 /// <summary>
94- /// Gets the longitude.
85+ /// Gets the longitude or X coordinate
9586 /// </summary>
9687 public double Longitude { get ; }
9788
0 commit comments