Class CoordinateSequenceComparator
Compares two CoordinateSequences.
Implements
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
public class CoordinateSequenceComparator : IComparer<CoordinateSequence>
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
| Improve this Doc View SourceCoordinateSequenceComparator()
Creates a comparator which will test all dimensions.
Declaration
public CoordinateSequenceComparator()
CoordinateSequenceComparator(Int32)
Creates a comparator which will test only the specified number of dimensions.
Declaration
public CoordinateSequenceComparator(int dimensionLimit)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dimensionLimit | The number of dimensions to test |
Fields
| Improve this Doc View SourceDimensionLimit
The number of dimensions to test
Declaration
protected int DimensionLimit
Field Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceCompare(CoordinateSequence, CoordinateSequence)
Compares two CoordinateSequences for relative order.
Declaration
public int Compare(CoordinateSequence s1, CoordinateSequence s2)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequence | s1 | A coordinate sequence |
CoordinateSequence | s2 | A coordinate sequence |
Returns
Type | Description |
---|---|
Int32 | -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.
Declaration
public static int Compare(double a, double b)
Parameters
Type | Name | Description |
---|---|---|
Double | a | A |
Double | b | A |
Returns
Type | Description |
---|---|
Int32 | -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.
Declaration
public int Compare(object o1, object o2)
Parameters
Type | Name | Description |
---|---|---|
Object | o1 | A coordinate sequence |
Object | o2 | A coordinate sequence |
Returns
Type | Description |
---|---|
Int32 | -1, 0, or 1 depending on whether o1 is less than, equal to, or greater than o2 |
CompareCoordinate(CoordinateSequence, CoordinateSequence, Int32, Int32)
Compares the same coordinate of two CoordinateSequences
Declaration
protected int CompareCoordinate(CoordinateSequence s1, CoordinateSequence s2, int i, int dimension)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequence | s1 | A coordinate sequence |
CoordinateSequence | s2 | A coordinate sequence |
Int32 | i | The index of the coordinate to test |
Int32 | dimension | the number of dimensions to test |
Returns
Type | Description |
---|---|
Int32 |