MobilityDB 1.3
Loading...
Searching...
No Matches

◆ node_split()

static void node_split ( RTree rtree,
RTreeNode node,
STBox box,
RTreeNode **  right_out 
)
static

Splits an RTree node and redistributes its STBoxes between two nodes.

This function splits an RTree node into two nodes by distributing the STBoxes based on the axis with the largest length. The STBoxes are moved to either the original node or a new right node, depending on their position relative to the splitting axis. After the initial split, the function ensures that both nodes have at least a minimum number of STBoxes by redistributing the STBoxes if necessary. If the node is a branch node, it also sorts both nodes by the first axis.

Parameters
[in]rtreePointer to the RTree structure, which provides methods for retrieving axis values and determining dimensions.
[in]nodePointer to the RTreeNode structure to be split.
[in]boxPointer to the STBox structure used to guide the split.
[out]right_outPointer to a pointer where the new RTreeNode (right node) will be stored.