Class KdNode<T>
A node of a KdTree<T>, which represents one or more points in the same location.
Inherited Members
Namespace: NetTopologySuite.Index.KdTree
Assembly: NetTopologySuite.dll
Syntax
public class KdNode<T> where T : class
Type Parameters
| Name | Description |
|---|---|
| T | The type of the object |
Constructors
| Edit this page View SourceKdNode(Coordinate, T)
Creates a new KdNode.
Declaration
public KdNode(Coordinate p, T data)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | p | The point location of new node |
| T | data | A data objects to associate with this node |
KdNode(double, double, T)
Creates a new KdNode.
Declaration
public KdNode(double x, double y, T data)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | coordinate of point |
| double | y | coordinate of point |
| T | data | A data objects to associate with this node |
Properties
| Edit this page View SourceCoordinate
Gets the location of this node
Declaration
public Coordinate Coordinate { get; }
Property Value
| Type | Description |
|---|---|
| Coordinate | The |
Count
Gets the number of inserted points that are coincident at this location.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Data
Gets the user data object associated with this node.
Declaration
public T Data { get; }
Property Value
| Type | Description |
|---|---|
| T | The user data |
IsRepeated
Gets whether more than one point with this value have been inserted (up to the tolerance)
Declaration
public bool IsRepeated { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Left
Gets or sets the left node of the tree
Declaration
public KdNode<T> Left { get; set; }
Property Value
| Type | Description |
|---|---|
| KdNode<T> | The left node |
Right
Gets or sets the right node of the tree
Declaration
public KdNode<T> Right { get; set; }
Property Value
| Type | Description |
|---|---|
| KdNode<T> | The right node |
X
Gets x-ordinate of this node
Declaration
public double X { get; }
Property Value
| Type | Description |
|---|---|
| double | The |
Y
Gets y-ordinate of this node
Declaration
public double Y { get; }
Property Value
| Type | Description |
|---|---|
| double | The |
Methods
| Edit this page View SourceSplitValue(bool)
Gets the split value at a node, depending on whether the node splits on X or Y. The X (or Y) ordinates of all points in the left subtree are less than the split value, and those in the right subtree are greater than or equal to the split value.
Declaration
public double SplitValue(bool isSplitOnX)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isSplitOnX | A flag whether the node splits a X or Y |
Returns
| Type | Description |
|---|---|
| double | The splitting value |