Package com.kheops.jmap.spatial.index
Class AbstractSTRtree<T>
java.lang.Object
com.kheops.jmap.spatial.index.AbstractSTRtree<T>
- Direct Known Subclasses:
- STRtree
Base class for STRtree and SIRtree. STR-packed R-trees are described in:
 P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With
 Application To GIS. Morgan Kaufmann, San Francisco, 2002.
 
This implementation is based on Boundables rather than just AbstractNodes, because the STR algorithm operates on both nodes and data, both of which are treated here as Boundables.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static interfaceA test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have different implementations of bounds.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractSTRtree(int nodeCapacity) Constructs an AbstractSTRtree with the specified maximum number of child nodes that a node may have
- 
Method SummaryModifier and TypeMethodDescriptionboundablesAtLevel(int level) voidbuild()Creates parent nodes, grandparent nodes, and so forth up to the root node, for the data that has been inserted into the tree.protected intcompareDoubles(double a, double b) protected abstract AbstractNodecreateNode(int level) createParentBoundables(List<Boundable> childBoundables, int newLevel) Sorts the childBoundables then divides them into groups of size M, where M is the node capacity.protected intdepth()protected intdepth(AbstractNode node) protected abstract Comparator<Boundable> protected abstract AbstractSTRtree.IntersectsOpintReturns the maximum number of child nodes that a node may haveprotected AbstractNodegetRoot()protected voidprotected AbstractNodeAlso builds the tree, if necessary.protected voidquery(Rectangle searchBounds, ItemVisitor<T> visitor) Also builds the tree, if necessary.protected booleanRemoves an item from the tree.protected intsize()protected intsize(AbstractNode node) 
- 
Field Details- 
root
 
- 
- 
Constructor Details- 
AbstractSTRtreepublic AbstractSTRtree(int nodeCapacity) Constructs an AbstractSTRtree with the specified maximum number of child nodes that a node may have
 
- 
- 
Method Details- 
buildpublic void build()Creates parent nodes, grandparent nodes, and so forth up to the root node, for the data that has been inserted into the tree. Can only be called once, and thus can be called only after all of the data has been inserted into the tree.
- 
createNode
- 
createParentBoundablesSorts the childBoundables then divides them into groups of size M, where M is the node capacity.
- 
lastNode
- 
compareDoublesprotected int compareDoubles(double a, double b) 
- 
getRoot
- 
getNodeCapacitypublic int getNodeCapacity()Returns the maximum number of child nodes that a node may have
- 
sizeprotected int size()
- 
size
- 
depthprotected int depth()
- 
depth
- 
insert
- 
queryAlso builds the tree, if necessary.
- 
queryAlso builds the tree, if necessary.
- 
getIntersectsOp- Returns:
- a test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have different implementations of bounds.
- See Also:
 
- 
removeRemoves an item from the tree. (Builds the tree, if necessary.)
- 
boundablesAtLevel
- 
getComparator
 
-