PostGIS  2.1.10dev-r@@SVN_REVISION@@
static RTREE_NODE* RTreeCreateInteriorNode ( RTREE_NODE left,
RTREE_NODE right 
)
static

Creates an interior node given the children.

Definition at line 134 of file lwgeom_rtree.c.

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

Referenced by RTreeCreate().

135 {
136  RTREE_NODE *parent;
137 
138  POSTGIS_DEBUGF(2, "RTreeCreateInteriorNode called for children %p, %p", left, right);
139 
140  parent = lwalloc(sizeof(RTREE_NODE));
141  parent->leftNode = left;
142  parent->rightNode = right;
143  parent->interval = RTreeMergeIntervals(left->interval, right->interval);
144  parent->segment = NULL;
145 
146  POSTGIS_DEBUGF(3, "RTreeCreateInteriorNode returning %p", parent);
147 
148  return parent;
149 }
The following struct and methods are used for a 1D RTree implementation, described at: http://lin-ear...
Definition: lwgeom_rtree.h:21
struct rtree_node * leftNode
Definition: lwgeom_rtree.h:24
RTREE_INTERVAL * interval
Definition: lwgeom_rtree.h:23
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:96
LWLINE * segment
Definition: lwgeom_rtree.h:26
struct rtree_node * rightNode
Definition: lwgeom_rtree.h:25
void * lwalloc(size_t size)
Definition: lwutil.c:175

Here is the call graph for this function:

Here is the caller graph for this function: