PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ RTreeCreateInteriorNode()

static RTREE_NODE* RTreeCreateInteriorNode ( RTREE_NODE left,
RTREE_NODE right 
)
static

Creates an interior node given the children.

Definition at line 148 of file lwgeom_rtree.c.

References rtree_node::interval, rtree_node::leftNode, lwalloc(), rtree_node::rightNode, RTreeMergeIntervals(), and rtree_node::segment.

Referenced by RTreeCreate().

149 {
150  RTREE_NODE *parent;
151 
152  POSTGIS_DEBUGF(2, "RTreeCreateInteriorNode called for children %p, %p", left, right);
153 
154  parent = lwalloc(sizeof(RTREE_NODE));
155  parent->leftNode = left;
156  parent->rightNode = right;
157  parent->interval = RTreeMergeIntervals(left->interval, right->interval);
158  parent->segment = NULL;
159 
160  POSTGIS_DEBUGF(3, "RTreeCreateInteriorNode returning %p", parent);
161 
162  return parent;
163 }
The following struct and methods are used for a 1D RTree implementation, described at: http://lin-ear...
Definition: lwgeom_rtree.h:45
struct rtree_node * leftNode
Definition: lwgeom_rtree.h:48
RTREE_INTERVAL * interval
Definition: lwgeom_rtree.h:47
static RTREE_INTERVAL * RTreeMergeIntervals(RTREE_INTERVAL *inter1, RTREE_INTERVAL *inter2)
Creates an interval with the total extents of the two given intervals.
Definition: lwgeom_rtree.c:110
LWLINE * segment
Definition: lwgeom_rtree.h:50
struct rtree_node * rightNode
Definition: lwgeom_rtree.h:49
void * lwalloc(size_t size)
Definition: lwutil.c:229
Here is the call graph for this function:
Here is the caller graph for this function: