Beispiel #1
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     unchecked
     {
         return((Radius.GetHashCode() * 397) ^ (Center != null ? Center.GetHashCode(options) : 0));
     }
 }
Beispiel #2
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     unchecked
     {
         return(((Shell != null ? Shell.GetHashCode(options) : 0) * 397) ^ (Holes != null ? Holes.GetHashCode(options) : 0));
     }
 }
Beispiel #3
0
        public static bool Equals(object obj1, object obj2, SpatialEqualityOptions options)
        {
            var spatialObj = obj1 as ISpatialEquatable;
            if (!ReferenceEquals(null, spatialObj))
                return spatialObj.Equals(obj2, options);

            return Equals(obj1, obj2);
        }
Beispiel #4
0
        public static bool Equals(object obj1, object obj2, SpatialEqualityOptions options)
        {
            var spatialObj = obj1 as ISpatialEquatable;

            if (!ReferenceEquals(null, spatialObj))
            {
                return(spatialObj.Equals(obj2, options));
            }

            return(Equals(obj1, obj2));
        }
Beispiel #5
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     unchecked
     {
         int hashCode = (Coordinate1 != null ? Coordinate1.GetHashCode(options) : 0);
         hashCode = (hashCode * 397) ^ (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0);
         hashCode = (hashCode * 397) ^ Distance.GetHashCode();
         hashCode = (hashCode * 397) ^ Bearing12.GetHashCode();
         hashCode = (hashCode * 397) ^ Bearing21.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #6
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as GeometryCollection;

            if (ReferenceEquals(null, other))
                return false;

            if (Geometries.Count != other.Geometries.Count)
                return false;

            return !Geometries
                .Where((t, i) => !t.Equals(other.Geometries[i], options))
                .Any();
        }
Beispiel #7
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as GeometryCollection;

            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (Geometries.Count != other.Geometries.Count)
            {
                return(false);
            }

            return(!Geometries
                   .Where((t, i) => !t.Equals(other.Geometries[i], options))
                   .Any());
        }
Beispiel #8
0
        public bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as SpatialReadOnlyCollection <TElement>;

            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (Count != other.Count)
            {
                return(false);
            }

            return(!this
                   .Where((t, i) => !SpatialObject.Equals(t, other[i], options))
                   .Any());
        }
Beispiel #9
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as Polygon;

            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (IsEmpty && other.IsEmpty)
            {
                return(true);
            }

            return(Shell.Equals(other.Shell, options) &&
                   Holes.Count == other.Holes.Count &&
                   !Holes
                   .Where((t, i) => !t.Equals(other.Holes[i], options))
                   .Any());
        }
Beispiel #10
0
 public abstract bool Equals(object obj, SpatialEqualityOptions options);
Beispiel #11
0
 public abstract int GetHashCode(SpatialEqualityOptions options);
Beispiel #12
0
 public abstract bool Equals(object obj, SpatialEqualityOptions options);
Beispiel #13
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as LineString;

            return(!ReferenceEquals(null, other) && Equals(Coordinates, other.Coordinates, options));
        }
Beispiel #14
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     return(Coordinates != null ? Coordinates.GetHashCode(options) : 0);
 }
Beispiel #15
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     return Geometries
         .Select(x => x.GetHashCode(options))
         .Aggregate(0, (current, result) => (current * 397) ^ result);
 }
Beispiel #16
0
 public override bool Equals(object obj, SpatialEqualityOptions options)
 {
     var other = obj as Point;
     return !ReferenceEquals(null, other) && Equals(Coordinate, other.Coordinate, options);
 }
Beispiel #17
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as Circle;

            return(!ReferenceEquals(null, other) && Radius.Equals(other.Radius) && Equals(Center, other.Center, options));
        }
Beispiel #18
0
 public override bool Equals(object obj, SpatialEqualityOptions options)
 {
     var other = obj as Circle;
     return !ReferenceEquals(null, other) && Radius.Equals(other.Radius) && Equals(Center, other.Center, options);
 }
Beispiel #19
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as GeodeticLine;

            return(!ReferenceEquals(null, other) && Equals(Coordinate1, other.Coordinate1, options) && Equals(Coordinate2, other.Coordinate2, options) && Distance.Equals(other.Distance) && Bearing12.Equals(other.Bearing12) && Bearing21.Equals(other.Bearing21));
        }
Beispiel #20
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     unchecked
     {
         return ((Shell != null ? Shell.GetHashCode(options) : 0)*397) ^ (Holes != null ? Holes.GetHashCode(options) : 0);
     }
 }
Beispiel #21
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as Polygon;

            if (ReferenceEquals(null, other))
                return false;

            if (IsEmpty && other.IsEmpty)
                return true;

            return Shell.Equals(other.Shell, options)
                && Holes.Count == other.Holes.Count
                && !Holes
                .Where((t, i) => !t.Equals(other.Holes[i], options))
                .Any();
        }
Beispiel #22
0
 public abstract int GetHashCode(SpatialEqualityOptions options);
Beispiel #23
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     unchecked
     {
         return (Radius.GetHashCode() * 397) ^ (Center != null ? Center.GetHashCode(options) : 0);
     }
 }
Beispiel #24
0
 public int GetHashCode(SpatialEqualityOptions options)
 {
     return(this
            .Select(x => x.GetHashCode(options))
            .Aggregate(0, (current, result) => (current * 397) ^ result));
 }
Beispiel #25
0
 public override int GetHashCode(SpatialEqualityOptions options)
 {
     return (Coordinate != null ? Coordinate.GetHashCode(options) : 0);
 }