public override int GetHashCode(SpatialEqualityOptions options) { unchecked { return ((Coordinate1 != null ? Coordinate1.GetHashCode(options) : 0) * 397) ^ (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0); } }
public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as Coordinate; if (ReferenceEquals(null, other)) return false; var other2 = other as CoordinateZ; if (ReferenceEquals(null, other2)) return false; if (options.UseElevation && !Elevation.Equals(other2.Elevation)) return false; if (Latitude.Equals(other.Latitude)) { if (options.PoleCoordiantesAreEqual && Latitude.Equals(90d) || Latitude.Equals(-90d)) return true; if (Longitude.Equals(other.Longitude)) return true; if (options.AntiMeridianCoordinatesAreEqual) { if (Longitude.Equals(180) && other.Longitude.Equals(-180) || Longitude.Equals(-180) && other.Longitude.Equals(180)) return true; } } return false; }
public override int GetHashCode(SpatialEqualityOptions options) { unchecked { var latitude = Latitude; var longitude = Longitude; if (options.PoleCoordiantesAreEqual && (Latitude.Equals(90) || Latitude.Equals(-90))) { longitude = 0; } else if (options.AntiMeridianCoordinatesAreEqual && Longitude.Equals(-180)) { longitude = 180; } var hashCode = latitude.GetHashCode(); hashCode = (hashCode * 397) ^ longitude.GetHashCode(); if (options.UseElevation) { hashCode = (hashCode * 397) ^ Measure.GetHashCode(); } return(hashCode); } }
public override int GetHashCode(SpatialEqualityOptions options) { unchecked { return(((Coordinate1 != null ? Coordinate1.GetHashCode(options) : 0) * 397) ^ (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0)); } }
public GeoContext(Spheroid spheroid) { Spheroid = spheroid; GeodeticCalculator = new SpheroidCalculator(spheroid); GeomagnetismCalculator = new GeomagnetismCalculator(spheroid); EqualityOptions = new SpatialEqualityOptions(); LongitudeWrapping = false; }
public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as Coordinate; if (ReferenceEquals(null, other)) { return(false); } var other2 = other as CoordinateZM; if (ReferenceEquals(null, other2)) { return(false); } if (options.UseElevation && !Elevation.Equals(other2.Elevation)) { return(false); } if (options.UseM && !Measure.Equals(other2.Measure)) { return(false); } if (Latitude.Equals(other.Latitude)) { if (options.PoleCoordiantesAreEqual && Latitude.Equals(90d) || Latitude.Equals(-90d)) { return(true); } if (Longitude.Equals(other.Longitude)) { return(true); } if (options.AntiMeridianCoordinatesAreEqual) { if (Longitude.Equals(180) && other.Longitude.Equals(-180) || Longitude.Equals(-180) && other.Longitude.Equals(180)) { return(true); } } } return(false); }
public override int GetHashCode(SpatialEqualityOptions options) { unchecked { var latitude = Latitude; var longitude = Longitude; if (options.PoleCoordiantesAreEqual && (Latitude.Equals(90) || Latitude.Equals(-90))) longitude = 0; else if (options.AntiMeridianCoordinatesAreEqual && Longitude.Equals(-180)) longitude = 180; var hashCode = latitude.GetHashCode(); hashCode = (hashCode * 397) ^ longitude.GetHashCode(); if (options.UseElevation) hashCode = (hashCode * 397) ^ Elevation.GetHashCode(); return hashCode; } }
public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as Coordinate; if (ReferenceEquals(null, other)) { return(false); } if (other.Is3D || other.IsMeasured) { return(false); } if (Latitude.Equals(other.Latitude)) { if (options.PoleCoordiantesAreEqual && Latitude.Equals(90d) || Latitude.Equals(-90d)) { return(true); } if (Longitude.Equals(other.Longitude)) { return(true); } if (options.AntiMeridianCoordinatesAreEqual) { if (Longitude.Equals(180) && other.Longitude.Equals(-180) || Longitude.Equals(-180) && other.Longitude.Equals(180)) { return(true); } } } return(false); }
public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as LineSegment; return !ReferenceEquals(null, other) && Equals(Coordinate1, other.Coordinate1, options) && Equals(Coordinate2, other.Coordinate2, options); }
public GeoContext() { GeodeticCalculator = SpheroidCalculator.Wgs84(); EqualityOptions = new SpatialEqualityOptions(); LongitudeWrapping = false; }
public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as LineSegment; return(!ReferenceEquals(null, other) && Equals(Coordinate1, other.Coordinate1, options) && Equals(Coordinate2, other.Coordinate2, options)); }
public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as Coordinate; if (ReferenceEquals(null, other)) return false; if (other.Is3D || other.IsMeasured) return false; if (Latitude.Equals(other.Latitude)) { if (options.PoleCoordiantesAreEqual && Latitude.Equals(90d) || Latitude.Equals(-90d)) return true; if (Longitude.Equals(other.Longitude)) return true; if (options.AntiMeridianCoordinatesAreEqual) { if (Longitude.Equals(180) && other.Longitude.Equals(-180) || Longitude.Equals(-180) && other.Longitude.Equals(180)) return true; } } return false; }