[libgfc Index] [libgfc Hierarchy] [Headers]
This class provides the RTree spatial index interface. More...
#include <src/rt.h>
RTrees are balanced multidimensional indexing structures. It is an extension of B+Trees, and is initialy devised by Guttman (1984).
RTrees can be used to index spatial objects such as points, lines
and polygons. It uses the minimum bounding rectangl (MBR) as the
abstracted representation of such spatial objects, and provides
efficient lookup of objects based on their locations.
The RTree implemented here is similar to the generalized search
tree (GiST) of Berkeley, but is a complete rewriting for the sake of
simplicity and efficiency, as well as better integration w/ the rest
of the GFC code.
Each node (RNode) in an RTree is stored as a page in the disk file (object of
the RTStore class) A node contains a set of entries (REntry) of the form
<Key, Pointer >, where the Key (RKey) is a MBR of type GRect, and the
Pointer may be a node ID or an object id, based on whether the entry is
in a non-leaf node or leaf node.
RTree class supports four types of search predicates, using the operator
"EQUALS, OVERLAPS, CONTAINS, WITHIN". Combination of such operators is not
supported yet.
This implementation is a version of Guttman's original RTree (using the
poly-time spliting algorithm). There have been various extensions of RTree
such as R*Tree, but they are not implemented here (yet).
[public virtual]
create an empty RTree with the given name
[public virtual]
open an existing RTree (for search/insertion etc)
[public virtual]
close an open RTree (flush the storage etc)
[public virtual]
report the statistics (contained in the header). This includes the total number of entries, nodes, the bounding box, and the average occupancy of the nodes.
[public virtual]
travase and print all the nodes of the RTree nicely
[public virtual]
Launch a search using the predicate p. It returns a cursor (an integer), which indicates the next available entry. The next() method is then subsequently called to retrieve all the satisfying entries.
[public virtual]
retrieves the next availabe entry indicated by the cursor. returns NULL if there is no more entries available, upon which the cursor is closed and no longer valid.
[public virtual]
bulk load the pre-sorted entries from "file"
Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999 | Kdoc |