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

◆ node_split()

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

Splits an RTree node and redistributes its bounding boxes between two nodes.

The function splits an RTree node into two nodes by distributing the bounding boxes based on the axis with the largest length. The bounding boxes 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 bounding boxes by redistributing the bounding boxes 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 node to be split
[in]boxPointer to the bounding box used to guide the split
[out]right_outPointer to a pointer where the new RTreeNode (right node) will be stored