public class RTree
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
RTree.ComparatorImpl |
class |
RTree.RTreePlot |
Constructor and Description |
---|
RTree(int nD, int nS, int mF)
Constructs an empty RTree with specified parameters
|
RTree(int nD, int nS, int mF, double tol)
Constructs an empty RTree with specified parameters
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(double[][] h, java.lang.Object o)
addEntry adds an entry at leaf level to the RTree.
|
boolean |
anyInteract(boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res, boolean reverse) |
boolean |
anyInteract(RTree b, java.util.ArrayList res) |
boolean |
anyInteract(RTree a, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res) |
boolean |
anyInteract(RTree a, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res, boolean reverse) |
double |
compArea(oracle.spatial.util.RTree.Span[] a) |
void |
compIntsxn(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b, oracle.spatial.util.RTree.Span[] res) |
double |
compMinDistance(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b) |
double |
compMinDistance(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b, double tol) |
int |
getEntryCount()
Gets the number of entries (inserted objects) in the tree
|
double[][] |
getMBH()
Gets the bounds of the whole tree
|
boolean |
intscts(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b) |
boolean |
intscts(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b, double tol) |
void |
leafDump() |
static void |
main(java.lang.String[] args) |
boolean |
nnSearch(double[][] searchMBR, java.util.ArrayList res) |
boolean |
nnSearch(RTree b, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res) |
boolean |
nnSearch(RTree b, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res, boolean reverse) |
void |
packTree(double[][][] mbhList, java.lang.Object[] pList)
Generates a highly ordered packed tree using the scan-tile-recursive method
|
boolean |
removeEntry(double[][] h, java.lang.Object obj)
removeEntry removes an entry from the leaf level of the RTree and makes any other tree adjustments necessary, including possibly the orphaning and reinsertion of subtrees at any level if nodes become underfilled
|
boolean |
search(double[][] h, java.util.ArrayList a)
Searches an RTree for all objects whose minimum bounding hypersolids intersect the input search hypersolid
|
void |
showRTreePlot() |
void |
showRTreePlot(java.lang.String title) |
public RTree(int nD, int nS, int mF, double tol)
nD
- Number of dimensions in the space indexed by the tree. Can be 1, 2, 3,...nS
- Node size; the number of entries per node. Since this is a RAM- resident tree there is no need to match node size with disk pages and node sizes of 5-12 will give best resultsmF
- Minimum fill - the number of entries in a node below which the node is considered underfull and the remaining entries orphaned and reinserted in the tree. If set to 1, there will be no orphaningtol
- Tolerance valuepublic RTree(int nD, int nS, int mF)
nD
- Number of dimensions in the space indexed by the tree. Can be 1, 2, 3,...nS
- Node size; the number of entries per node. Since this is a RAM- resident tree there is no need to match node size with disk pages and node sizes of 5-12 will give best resultsmF
- Minimum fill - the number of entries in a node below which the node is considered underfull and the remaining entries orphaned and reinserted in the tree. If set to 1, there will be no orphaningpublic double[][] getMBH()
public int getEntryCount()
public boolean search(double[][] h, java.util.ArrayList a)
h
- two dimensional array of doubles which are the minimum bounding hypersolid defining the search. The first index ranges over 0,nDimensions-1 and is the dimension of the space. The second index ranges over 0,1 and specifies the min and max.a
- The ArrayList holds the objects found to satisfy the search. Should be preallocated by the caller and set via the constructor or ensureCapacity(int) for expected result size (for efficiency). Will not overflow if undersized.public void addEntry(double[][] h, java.lang.Object o)
h
- two dimensional array of doubles defining the minimum bounding hypersolid of the added object. The first index ranges over 0,nDim-1 where nDim is the dimension of the space (1,2,3...). The second index ranges over 0,1 and selects the min and maxo
- The inserted Object referencepublic boolean removeEntry(double[][] h, java.lang.Object obj)
h
- two dimensional array of doubles defining the minimum bounding hypersolid of the removed object. The first index ranges over 0,nDimensions-1 and is the dimension of the space. The second index ranges over 0,1 and specifies the min or maxobj
- The removed Object referencepublic void packTree(double[][][] mbhList, java.lang.Object[] pList) throws java.lang.Exception
mbhList
- A list of mbh objects which is a three dimensional array of doubles. The first index ranges over 0,num-1 of entries. The second index ranges over 0,ndim-1 the size of the space The third index ranges over 0,1 for min, max.pList
- An array of Object references. The length of the array is the same as the number of entries in the array of MBHs (the first index).java.lang.Exception
public boolean intscts(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b)
public boolean intscts(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b, double tol)
public double compMinDistance(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b)
public double compMinDistance(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b, double tol)
public void compIntsxn(oracle.spatial.util.RTree.Span[] a, oracle.spatial.util.RTree.Span[] b, oracle.spatial.util.RTree.Span[] res)
public double compArea(oracle.spatial.util.RTree.Span[] a)
public boolean anyInteract(RTree b, java.util.ArrayList res) throws java.lang.Exception
java.lang.Exception
public boolean anyInteract(RTree a, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res) throws java.lang.Exception
java.lang.Exception
public boolean anyInteract(RTree a, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res, boolean reverse) throws java.lang.Exception
java.lang.Exception
public boolean anyInteract(boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res, boolean reverse) throws java.lang.Exception
java.lang.Exception
public boolean nnSearch(double[][] searchMBR, java.util.ArrayList res) throws java.lang.Exception
java.lang.Exception
public boolean nnSearch(RTree b, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res) throws java.lang.Exception
java.lang.Exception
public boolean nnSearch(RTree b, boolean chkLfIntsxn, boolean getAllResults, java.util.ArrayList res, boolean reverse) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args) throws java.io.IOException, java.lang.Exception
java.io.IOException
java.lang.Exception
public void leafDump()
public void showRTreePlot(java.lang.String title)
public void showRTreePlot()