/// <summary> /// Initializes a new instance of the <see cref="Point"/> class. /// </summary> /// <param name="coordinates">The Position.</param> public Point(GeographicPosition coordinates) { if (coordinates == null) { throw new ArgumentNullException("coordinates"); } //this.Coordinates = new List<IPosition> { coordinates }; this.Coordinates = coordinates; this.Type = GeoJSONObjectType.Point; }
/// <summary> /// Determines whether the specified GeographicPosition is equal to this instance. /// </summary> /// <param name="other">The GeographicPosition to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified GeographicPosition is equal to this instance; otherwise, <c>false</c>. /// </returns> public bool Equals(GeographicPosition other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } const double precision = 0.0001; return(Math.Abs(this.Latitude - other.Latitude) < precision && Math.Abs(this.Longitude - other.Longitude) < precision && Math.Abs(this.Altitude.GetValueOrDefault() - other.Altitude.GetValueOrDefault()) < precision); }