Class KdNode
java.lang.Object
org.locationtech.jts.index.kdtree.KdNode
A node of a
KdTree
, which represents one or more points in the same location.- Author:
- dskea
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new KdNode.KdNode
(Coordinate p, Object data) Creates a new KdNode. -
Method Summary
Modifier and TypeMethodDescriptionReturns the location of this nodeint
getCount()
Returns the number of inserted points that are coincident at this location.getData()
Gets the user data object associated with this node.getLeft()
Returns the left node of the treegetRight()
Returns the right node of the treedouble
getX()
Returns the X coordinate of the nodedouble
getY()
Returns the Y coordinate of the nodeboolean
Tests whether more than one point with this value have been inserted (up to the tolerance)double
splitValue
(boolean isSplitOnX) Gets the split value at a node, depending on whether the node splits on X or Y.
-
Constructor Details
-
KdNode
Creates a new KdNode.- Parameters:
_x
- coordinate of point_y
- coordinate of pointdata
- a data objects to associate with this node
-
KdNode
Creates a new KdNode.- Parameters:
p
- point location of new nodedata
- a data objects to associate with this node
-
-
Method Details
-
getX
public double getX()Returns the X coordinate of the node- Returns:
- X coordinate of the node
-
getY
public double getY()Returns the Y coordinate of the node- Returns:
- Y coordinate of the node
-
splitValue
public double splitValue(boolean isSplitOnX) 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.- Parameters:
isSplitOnX
- whether the node splits on X or Y- Returns:
- the splitting value
-
getCoordinate
Returns the location of this node- Returns:
- p location of this node
-
getData
Gets the user data object associated with this node.- Returns:
- user data
-
getLeft
Returns the left node of the tree- Returns:
- left node
-
getRight
Returns the right node of the tree- Returns:
- right node
-
getCount
public int getCount()Returns the number of inserted points that are coincident at this location.- Returns:
- number of inserted points that this node represents
-
isRepeated
public boolean isRepeated()Tests whether more than one point with this value have been inserted (up to the tolerance)- Returns:
- true if more than one point have been inserted with this value
-