| java.lang.Object org.geotools.caching.quatree.QuadTree
QuadTree | public class QuadTree implements ISpatialIndex(Code) | | A QuadTree implementation, inspired by the shapefile quadtree in org.geotools.index.quadtree,
but using visitors and query strategies to customize how the tree is visited or run specialized queries.
Other noticeable changes from original QuadTree :
- tree delegates splitting to nodes
See Also: org.geotools.index.quadtree.QuadTree See Also: http://research.att.com/~marioh/spatialindex author: Christophe Rousson, SoC 2007, CRG-ULAVAL author: 2007-07-10: implemented maximum depth : allow to specify that the tree must not grow more than n levels author: TODO: implement full interface author: 2007-07-11: allowed to extend the tree from top, by changing root node author: TODO: make tree serializable or loadable from disk |
Inner Class :class Data implements IData | |
Field Summary | |
final protected static Logger | LOGGER | final protected static double | SPLITRATIO Control how much sub-quadrants do overlap. | protected Node | root First node of the tree, pointing recursively to all other nodes. |
Constructor Summary | |
public | QuadTree(Region bounds, int maxHeight) Creates a new QuadTree with first node with given bounds. | public | QuadTree(Region bounds) Creates a new QuadTree with first node with given bounds. |
Method Summary | |
public void | addDeleteNodeCommand(INodeCommand nc) | public void | addReadNodeCommand(INodeCommand nc) | public void | addWriteNodeCommand(INodeCommand nc) | public void | containmentQuery(IShape query, IVisitor v) | public boolean | deleteData(IShape shape, int id) | public void | flush() | public PropertySet | getIndexProperties() | public IStatistics | getStatistics() | public void | insertData(byte[] data, IShape shape, int id) | public void | intersectionQuery(IShape query, IVisitor v) | public boolean | isIndexValid() | public void | nearestNeighborQuery(int k, IShape query, IVisitor v, INearestNeighborComparator nnc) | public void | nearestNeighborQuery(int k, IShape query, IVisitor v) | public void | pointLocationQuery(IShape query, IVisitor v) | public void | queryStrategy(IQueryStrategy qs) | public void | queryStrategy(QueryStrategy qs) This a variant of the original interface method, using nodes directly rather than references to nodes using ids,
as in this implementation nodes does not have a unique ID in the tree, they have a unique ID in their quadrant. |
SPLITRATIO | final protected static double SPLITRATIO(Code) | | Control how much sub-quadrants do overlap.
if ratio = 0.5, quadrants will not overlap at all.
I guess that we want quadrants to overlap a bit, due to roundoff errors.
Defaults to orginial value picked in org.geotools.index.quadtree.QuadTree
|
root | protected Node root(Code) | | First node of the tree, pointing recursively to all other nodes.
|
QuadTree | public QuadTree(Region bounds, int maxHeight)(Code) | | Creates a new QuadTree with first node with given bounds.
Parameters: bounds - root node bounds. Parameters: maxHeight - is the maximum height of the tree |
QuadTree | public QuadTree(Region bounds)(Code) | | Creates a new QuadTree with first node with given bounds.
Tree height defaults to 20 levels.
Use @see QuadTree(Region, int) to specify height.
Parameters: root - node bounds |
deleteData | public boolean deleteData(IShape shape, int id)(Code) | | |
insertData | public void insertData(byte[] data, IShape shape, int id)(Code) | | |
isIndexValid | public boolean isIndexValid()(Code) | | |
|
|