Represents a point with a value.
Geometry represents a box (or point).
Geometry represents a box (or point).
(x1, y1) is the lower left point and (x2, y2) is upper right.
So Box(1, 2, 5, 4) is at (1, 2) and is 4 wide and 2 high. Points have no width or height, so x2/y2 are equal to x/y.
Abstract data type that has a geom element.
Abstract data type that has a geom element.
This generalizes Node[A] (the nodes of the tree) and Entry[A] (the values being put in the tree). It functions like a structural type (but isn't one, because structural types are slow).
This is a small ADT that we use to avoid building too many intermediate vectors.
This is a small ADT that we use to avoid building too many intermediate vectors.
It allows us to concatenate a whole bunch of vectors or single elements cheaply, and then iterate over them later.
Abstract data type for nodes of the tree.
Abstract data type for nodes of the tree.
There are two types of Node: Branch and Leaf. Confusingly, leaves don't actaully hold values, but rather a leaf contains a sequence of entries. This design is commmon to RTree implementations and it seemed like a good idea to keep the nomenclature the same.
This is the magnificent RTree, which makes searching ad-hoc geographic data fast and fun.
This is the magnificent RTree, which makes searching ad-hoc geographic data fast and fun.
The RTree wraps a node called 'root' that is the actual root of the tree structure. RTree also keeps track of the total size of the tree (something that individual nodes don't do).
Represents a point with a value.
We frequently use value.== so it's important that A have a reasonable equality definition. Otherwise things like remove and contains may not work very well.