Class QuadTree
Object
QuadTree
- All Implemented Interfaces:
Closeable
,AutoCloseable
Java porting of mapserver quadtree implementation.
Note that this implementation is not thread safe, so don't share the same instance across two or more threads.
Note that this implementation is not thread safe, so don't share the same instance across two or more threads.
TODO: example of typical use...
- Author:
- Tommaso Nolli
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Closes this QuadTree after use...int
int
getRoot()
void
Inserts a shape record id in the quadtreevoid
Inserts a shape record id in the quadtreevoid
registerIterator
(Iterator<Data> object) void
setMaxDepth
(int maxDepth) void
setNumShapes
(int numShapes) void
boolean
trim()
-
Constructor Details
-
QuadTree
Constructor. The maxDepth will be calculated.- Parameters:
numShapes
- The total number of shapes to indexmaxBounds
- The bounds of all geometries to be indexed
-
QuadTree
Constructor.- Parameters:
numShapes
- The total number of shapes to indexmaxDepth
- The max depth of the index, must be <= 65535maxBounds
- The bounds of all geometries to be indexed
-
QuadTree
Constructor. WARNING: using this constructor, you have to manually set the root- Parameters:
numShapes
- The total number of shapes to indexmaxDepth
- The max depth of the index, must be <= 65535
-
-
Method Details
-
insert
Inserts a shape record id in the quadtree- Parameters:
recno
- The record numberbounds
- The bounding box- Throws:
StoreException
-
insert
Inserts a shape record id in the quadtree- Throws:
StoreException
-
search
- Returns:
- A List of Integer
- Throws:
StoreException
-
close
Closes this QuadTree after use...- Throws:
IOException
-
trim
- Throws:
StoreException
-
getMaxDepth
public int getMaxDepth()- Returns:
- Returns the maxDepth.
-
setMaxDepth
public void setMaxDepth(int maxDepth) - Parameters:
maxDepth
- The maxDepth to set.
-
getNumShapes
public int getNumShapes()- Returns:
- Returns the numShapes.
-
setNumShapes
public void setNumShapes(int numShapes) - Parameters:
numShapes
- The numShapes to set.
-
getRoot
- Returns:
- Returns the root.
-
setRoot
- Parameters:
root
- The root to set.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
StoreException
-
registerIterator
-
getIndexfile
-