PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ rect_nodes_merge()

static RECT_NODE* rect_nodes_merge ( RECT_NODE **  nodes,
uint32_t  num_nodes 
)
static

Definition at line 596 of file lwtree.c.

597 {
598  if (num_nodes < 1)
599  {
600  return NULL;
601  }
602 
603  while (num_nodes > 1)
604  {
605  uint32_t i, k = 0;
606  RECT_NODE *node = NULL;
607  for (i = 0; i < num_nodes; i++)
608  {
609  if (!node)
610  node = rect_node_internal_new(nodes[i]);
611 
612  rect_node_internal_add_node(node, nodes[i]);
613 
614  if (node->i.num_nodes == RECT_NODE_SIZE)
615  {
616  nodes[k++] = node;
617  node = NULL;
618  }
619  }
620  if (node)
621  nodes[k++] = node;
622  num_nodes = k;
623  }
624 
625  return nodes[0];
626 }
static void rect_node_internal_add_node(RECT_NODE *node, RECT_NODE *add)
Definition: lwtree.c:556
static RECT_NODE * rect_node_internal_new(const RECT_NODE *seed)
Definition: lwtree.c:570
#define RECT_NODE_SIZE
Definition: lwtree.h:25
RECT_NODE_INTERNAL i
Definition: lwtree.h:75
unsigned int uint32_t
Definition: uthash.h:78

References rect_node::i, RECT_NODE_INTERNAL::num_nodes, rect_node_internal_add_node(), rect_node_internal_new(), and RECT_NODE_SIZE.

Referenced by rect_tree_from_lwcollection(), rect_tree_from_lwcurvepoly(), rect_tree_from_lwpoly(), and rect_tree_from_ptarray().

Here is the call graph for this function:
Here is the caller graph for this function: