Search Results for

    Show / Hide Table of Contents

    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
    object
    EqualityComparer<Coordinate>
    CoordinateEqualityComparer
    PerOrdinateEqualityComparer
    Implements
    IEqualityComparer<Coordinate>
    IEqualityComparer
    Inherited Members
    EqualityComparer<Coordinate>.Default
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Geometries
    Assembly: NetTopologySuite.dll
    Syntax
    public class CoordinateEqualityComparer : EqualityComparer<Coordinate>, IEqualityComparer<Coordinate>, IEqualityComparer

    Methods

    | Edit this page View Source

    AreEqual(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

    true if a and b can be considered equal.

    | Edit this page View Source

    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
    EqualityComparer<Coordinate>.Equals(Coordinate, Coordinate)
    | Edit this page 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

    Coordinate y

    A Coordinate

    double tolerance

    A tolerance value.

    Returns
    Type Description
    bool

    true if x and y can be considered equal; otherwise false.

    | Edit this page View Source

    GetHashCode(Coordinate)

    Declaration
    public override sealed int GetHashCode(Coordinate c)
    Parameters
    Type Name Description
    Coordinate c
    Returns
    Type Description
    int
    Overrides
    EqualityComparer<Coordinate>.GetHashCode(Coordinate)

    Implements

    IEqualityComparer<T>
    IEqualityComparer
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX