Class CoordinateSequenceComparator
- Namespace
- NetTopologySuite.Geometries
- Assembly
- NetTopologySuite.dll
Compares two CoordinateSequences.
public class CoordinateSequenceComparator : IComparer<CoordinateSequence>
- Inheritance
-
CoordinateSequenceComparator
- Implements
- Inherited Members
Remarks
For sequences of the same dimension, the ordering is lexicographic. Otherwise, lower dimensions are sorted before higher. The dimensions compared can be limited; if this is done ordinate dimensions above the limit will not be compared.
If different behaviour is required for comparing size, dimension, or coordinate values, any or all methods can be overridden.
Constructors
CoordinateSequenceComparator()
Creates a comparator which will test all dimensions.
public CoordinateSequenceComparator()
CoordinateSequenceComparator(int)
Creates a comparator which will test only the specified number of dimensions.
public CoordinateSequenceComparator(int dimensionLimit)
Parameters
dimensionLimit
intThe number of dimensions to test
Fields
DimensionLimit
The number of dimensions to test
protected int DimensionLimit
Field Value
Methods
Compare(CoordinateSequence, CoordinateSequence)
Compares two CoordinateSequences for relative order.
public int Compare(CoordinateSequence s1, CoordinateSequence s2)
Parameters
s1
CoordinateSequenceA coordinate sequence
s2
CoordinateSequenceA coordinate sequence
Returns
- int
-1, 0, or 1 depending on whether s1 is less than, equal to, or greater than s2
Compare(double, double)
Compare two double
s, allowing for NaN values.
NaN is treated as being less than any valid number.
public static int Compare(double a, double b)
Parameters
Returns
- int
-1, 0, or 1 depending on whether a is less than, equal to or greater than b
Compare(object, object)
Compares two CoordinateSequences for relative order.
public int Compare(object o1, object o2)
Parameters
Returns
- int
-1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2
CompareCoordinate(CoordinateSequence, CoordinateSequence, int, int)
Compares the same coordinate of two CoordinateSequences
protected int CompareCoordinate(CoordinateSequence s1, CoordinateSequence s2, int i, int dimension)
Parameters
s1
CoordinateSequenceA coordinate sequence
s2
CoordinateSequenceA coordinate sequence
i
intThe index of the coordinate to test
dimension
intthe number of dimensions to test