|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.khelekore.prtree.PRTree<T>
T - the data type stored in the PRTreepublic class PRTree<T>
A Priority R-Tree, a spatial index, for N dimensions. This tree only supports bulk loading.
| Constructor Summary | |
|---|---|
PRTree(MBRConverter<T> converter,
int branchFactor)
Create a new PRTree using the specified branch factor. |
|
| Method Summary | |
|---|---|
Iterable<T> |
find(double xmin,
double ymin,
double xmax,
double ymax)
Find all objects that intersect the given rectangle. |
void |
find(double xmin,
double ymin,
double xmax,
double ymax,
List<T> resultNodes)
Finds all objects that intersect the given rectangle and stores the found node in the given list. |
Iterable<T> |
find(MBR query)
Find all objects that intersect the given rectangle. |
void |
find(MBR query,
List<T> resultNodes)
Finds all objects that intersect the given rectangle and stores the found node in the given list. |
int |
getHeight()
Get the height of this tree. |
MBR |
getMBR()
Get an N dimensional minimum bounding box of the data stored in this tree. |
MBR2D |
getMBR2D()
Get a 2 dimensional minimum bounding rectangle of the data stored in this tree. |
int |
getNumberOfLeaves()
Get the number of data leafs in this tree. |
boolean |
isEmpty()
Check if this tree is empty |
void |
load(Collection<? extends T> data)
Bulk load data into this tree. |
List<DistanceResult<T>> |
nearestNeighbour(DistanceCalculator<T> dc,
NodeFilter<T> filter,
int maxHits,
PointND p)
Get the nearest neighbour of the given point |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PRTree(MBRConverter<T> converter,
int branchFactor)
converter - the MBRConverter to use for this treebranchFactor - the number of child nodes for each internal node.| Method Detail |
|---|
public void load(Collection<? extends T> data)
data - the collection of data to store in the tree.
IllegalStateException - if the tree is already loadedpublic MBR2D getMBR2D()
public MBR getMBR()
public int getNumberOfLeaves()
public boolean isEmpty()
public int getHeight()
public void find(double xmin,
double ymin,
double xmax,
double ymax,
List<T> resultNodes)
xmin - the minimum value of the x coordinate when searchingymin - the minimum value of the y coordinate when searchingxmax - the maximum value of the x coordinate when searchingymax - the maximum value of the y coordinate when searchingresultNodes - the list that will be filled with the result
public void find(MBR query,
List<T> resultNodes)
query - the bounds of the queryresultNodes - the list that will be filled with the result
public Iterable<T> find(double xmin,
double ymin,
double xmax,
double ymax)
xmin - the minimum value of the x coordinate when searchingymin - the minimum value of the y coordinate when searchingxmax - the maximum value of the x coordinate when searchingymax - the maximum value of the y coordinate when searching
IllegalArgumentException - if xmin > xmax or ymin > ymaxpublic Iterable<T> find(MBR query)
query - the bounds of the query
IllegalArgumentException - if xmin > xmax or ymin > ymax
public List<DistanceResult<T>> nearestNeighbour(DistanceCalculator<T> dc,
NodeFilter<T> filter,
int maxHits,
PointND p)
dc - the DistanceCalculator to use.filter - a NodeFilter that can be used to ignore some leaf nodes.maxHits - the maximum number of entries to find.p - the point to find the nearest neighbour to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||