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 coordinatesx
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
| Edit this page 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 |
---|---|
bool |
|
Equals(Coordinate, Coordinate)
Declaration
public override sealed bool Equals(Coordinate x, Coordinate y)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | x | |
Coordinate | y |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceEquals(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 |
---|---|
bool |
|
GetHashCode(Coordinate)
Declaration
public override sealed int GetHashCode(Coordinate c)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | c |
Returns
Type | Description |
---|---|
int |