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

◆ node_choose_least_enlargement()

static int node_choose_least_enlargement ( const RTreeNode node,
const STBox box,
const RTree rtree 
)
static

Selects the child node that requires the least enlargement to accommodate a new STBox.

This function iterates through the child nodes of a given RTree node to determine which child node's bounding box would need the least enlargement to include a new STBox. The function calculates the area of each node's bounding box before and after union with the new STBox and selects the one with the smallest area increase.

Parameters
[in]nodePointer to the RTreeNode structure containing the child nodes.
[in]boxPointer to the STBox structure that is being inserted or considered.
[in]rtreePointer to the RTree structure, which provides the method for calculating areas.
Returns
The index of the child node that requires the least enlargement.