Insert Algorithm in R-tree -
overview
Insert Algorithm in R-tree
Inserting the
index
(mbb, ObjID) into an
R-tree:
Algorithm to
handle
internal node
n
Algorithm to
handle
leaf node
n
How to
insert a
search key in the
R-tree:
Insert Algorithm in R-tree
Inserting the
index
(mbb, ObjID) into an
R-tree:
If a bounding box in
node n contains
mbb:
insert
(mbb, ObjID) in
its subtree
else:
enlarge a
bounding box in
node n to
contains
mbb and
insert
(mbb, ObjID) in
its subtree
If leaf node has
space:
add (mbb, ObjID) in
leaf node -
done
else:
split leaf node's objects
into 2 set and
replace BB, ptr)
in parent node by
2 new bounding boxes and
subtree pointers
Algorithm is
in this webpage below....
Insert Algorithm in R-tree -
Example 1 (easy case)
Insert the
object x into
the R-tree index:
The original
R-tree index is as follows:
Insert Algorithm in R-tree -
Example 1 (easy case)
Insert the
object x into
the R-tree index:
Bounding box ((0,0),(60,50))
contains object x index;
we insert it in
its subtree
Insert Algorithm in R-tree -
Example 1 (easy case)
Insert the
object x into
the R-tree index:
The leaf node has room:
insert the
index (mbb, x) in the
leaf node -
done
Insert Algorithm in R-tree -
Example 2 (enlarge BB)
Insert the
object x into
the R-tree index:
The original
R-tree index is as follows:
Insert Algorithm in R-tree -
Example 2 (enlarge BB)
Insert the
object x into
the R-tree index:
Bounding box ((0,0),(60,50))
does not contain
object x index...
try next subtree
Insert Algorithm in R-tree -
Example 2 (enlarge BB)
Insert the
object x into
the R-tree index:
Bounding box ((20,20),(100,80))
does not contain
object x index...
no more subtrees -
enlarge
an existing BB !
Insert Algorithm in R-tree -
Example 2 (enlarge BB)
Insert the
object x into
the R-tree index:
After enlarging
boundingbox to
((0,0),(60,60)):
Insert Algorithm in R-tree -
Example 2 (enlarge BB)
Insert the
object x into
the R-tree index:
We can now insert
object x in the
subtree
(because x is inside
the bounding box):
Insert Algorithm in R-tree -
Example 2 (enlarge BB)
Insert the
object x into
the R-tree index:
The leaf node
has room: insert
the index (mbb, x) in the
leaf node -
done
Insert Algorithm in R-tree -
Example 3 (split node)
Insert the
object x into
the R-tree index:
The initial
R-tree index:
Insert Algorithm in R-tree -
Example 3 (split node)
Insert the
object x into
the R-tree index:
Find the first leaf node
that contains the
object x:
Leaf node is
full - we
split the
objects over
2 nodes
Insert Algorithm in R-tree -
Example 3 (split node)
Split the
objects
(including object x) over
2 nodes as follows:
The 2 nodes are
indexed as
subtrees of
the bounding boxes
BB1 and
BB2:
Leaf node is
full - we
split the
objects over
2 nodes
Notable differences between
B+-tree insertion and
R-tree insertion - #1
We may need to
augment a
bounding box (= index range)
in R-tree:
After
enlarging the
(indexing)
bounding box:
Notable differences between
B+-tree insertion and
R-tree insertion - #2
Notable differences between
B+-tree insertion and
R-tree insertion - #2
Notable differences between
B+-tree insertion and
R-tree insertion - #2
❮
❯