RTree<T> class abstract

Abstract base implementation of the R-Tree data structure, based on the Python implementation from https://github.com/lukas-shawford/rtreelib.

Annotations
  • @experimental

Constructors

RTree({int? minEntries, int? maxEntries})
Internal constructor for the R-Tree.
RTree.guttmann({int? minEntries, int? maxEntries})
Constructs a Guttman R-Tree described in this paper: http://www-db.deis.unibo.it/courses/SI-LS/papers/Gut84.pdf
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
maxEntries int
Maximum number of entries per node.
final
minEntries int
Minimum number of entries per node.
final
root RTreeNode<T>
The root node of the tree.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

adjustTree(RTreeNode<T> node, RTreeNode<T>? splitNode) → void
Ascend from a leaf node to the root, adjusting covering rectangles and propagating node splits as necessary.
chooseLeaf(RTreeEntry<T> entry) RTreeNode<T>
Select a leaf node in which to place a new index entry.
growTree(Iterable<RTreeNode<T>> nodes) RTreeNode<T>
Grows the R-Tree by creating a new root node, with the given nodes as children.
insert(Bounds bound, T data) RTreeEntry<T>
Associates data with the provided bound.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overflowStrategy(RTreeNode<T> node) RTreeNode<T>?
Split an overflowing node.
queryEntries(Bounds bounds) Iterable<RTreeEntry<T>>
Queries leaf entries for a location (either a point or a rectangle), returning an iterable.
queryNodes(Bounds bounds, {bool leaves = true}) Iterable<RTreeNode<T>>
Queries nodes for a location (either a point or a rectangle), returning an iterable. By default, this method returns only leaf nodes, though intermediate-level nodes can also be returned by setting the leaves parameter to False.
searchEntries({Predicate1<RTreeNode<T>>? nodePredicate, Predicate1<RTreeEntry<T>>? entryPredicate}) Iterable<RTreeEntry<T>>
Traverses the tree, returning leaf entries that match a condition. This method optionally accepts both a node condition and an entry condition. The node condition is evaluated at each level and eliminates entire subtrees. In order for a leaf entry to be returned, all parent node conditions must pass. The entry condition is evaluated only at the leaf level. Both conditions are optional, and if neither is passed in, all leaf entries are returned.
searchNodes({Predicate1<RTreeNode<T>>? nodePredicate, bool leaves = true}) Iterable<RTreeNode<T>>
Traverses the tree, returning nodes that match a condition. By default, this method returns only leaf nodes, but intermediate-level nodes can also be returned by passing leaves=False. The condition is evaluated for each node at every level of the tree, and if it returns False, the entire subtree is eliminated.
splitNode(RTreeNode<T> node, List<RTreeEntry<T>> group1, List<RTreeEntry<T>> group2) RTreeNode<T>
Splits a given node into two nodes. The original node will have the entries specified in group1, and the newly-created split node will have the entries specified in group2. Both the original and split node will have their children nodes adjusted so they have the correct parent.
toString() String
A string representation of this object.
inherited
traverse<R>(Map1<RTreeNode<T>, Iterable<R>> callback, {Predicate1<RTreeNode<T>>? condition}) Iterable<R>
Traverses the nodes of the R-Tree in depth-first order, calling the given function on each node. A condition function may optionally be passed to filter which nodes get traversed. If condition returns False, then neither the node nor any of its descendants will be traversed.

Operators

operator ==(Object other) bool
The equality operator.
inherited