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

◆ node_insert()

static void node_insert ( RTree rtree,
STBox node_bounding_box,
RTreeNode node,
STBox new_box,
int  id,
bool split 
)
static

Inserts an STBox into an RTree node and handles node splitting if necessary.

This function inserts a new STBox into an RTree node. If the node is a leaf and already contains the maximum number of items (MAXITEMS), it sets the split flag to true to indicate that the node needs to be split. For non-leaf nodes, the function determines the appropriate child node for insertion and recursively inserts the STBox. If splitting occurs, the function handles the split and updates the parent node's bounding boxes.

Parameters
[in]rtreePointer to the RTree structure that provides axis value retrieval and node splitting functions.
[in]node_bounding_boxPointer to the bounding STBox of all the STBoxes in node
[in]nodePointer to the RTreeNode structure where the STBox is being inserted.
[in]new_boxPointer to the STBox to be inserted.
[in]idIdentifier associated with the new STBox (used only for leaf nodes).
[out]splitPointer to a boolean flag that indicates if the node was split during insertion.