Class CoordinateEqualityComparer
A class that can be used to test coordinates for equality.
It uses the algorithm that was default for NTS prior to v2.2,
i.e. checks if the 2d distance between coordinates x
and y
is less than or equal to a tolerance value.
Inheritance
CoordinateEqualityComparer
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
public class CoordinateEqualityComparer : EqualityComparer<Coordinate>, IEqualityComparer<Coordinate>, IEqualityComparer
Methods
| Improve this Doc View SourceAreEqual(Coordinate, Coordinate, Double)
Method to test 2 Coordinates for equality, allowing a tolerance.
Declaration
protected virtual bool AreEqual(Coordinate a, Coordinate b, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | a | The 1st Coordinate |
Coordinate | b | The 2nd Coordinate |
Double | tolerance | A tolerance value |
Returns
Type | Description |
---|---|
Boolean |
|
Equals(Coordinate, Coordinate)
Declaration
public sealed override bool Equals(Coordinate x, Coordinate y)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | x | |
Coordinate | y |
Returns
Type | Description |
---|---|
Boolean |
Overrides
System.Collections.Generic.EqualityComparer<NetTopologySuite.Geometries.Coordinate>.Equals(NetTopologySuite.Geometries.Coordinate, NetTopologySuite.Geometries.Coordinate)
|
Improve this Doc
View Source
Equals(Coordinate, Coordinate, Double)
Compares Coordinates x
and y
for equality allowing for a tolerance
.
Declaration
public bool Equals(Coordinate x, Coordinate y, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | x | A |
Coordinate | y | A |
Double | tolerance | A tolerance value. |
Returns
Type | Description |
---|---|
Boolean |
|
GetHashCode(Coordinate)
Declaration
public sealed override int GetHashCode(Coordinate c)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | c |
Returns
Type | Description |
---|---|
Int32 |
Overrides
System.Collections.Generic.EqualityComparer<NetTopologySuite.Geometries.Coordinate>.GetHashCode(NetTopologySuite.Geometries.Coordinate)