public class QuadTree<T> extends Object implements SpatialIndex<T>, Serializable
| Modifier | Constructor and Description |
|---|---|
|
QuadTree() |
|
QuadTree(GeometryFactory geometryFactory) |
protected |
QuadTree(IdObjectNode<T> root) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
protected double[] |
convert(BoundingBox boundingBox) |
int |
depth() |
static double[] |
ensureExtent(double[] bounds,
double minExtent) |
List<T> |
getAll() |
T |
getFirst(BoundingBox boundingBox,
Filter<T> filter) |
T |
getFirstBoundingBox(Geometry geometry,
Filter<T> filter) |
GeometryFactory |
getGeometryFactory() |
int |
getSize() |
void |
insert(BoundingBox boundingBox,
T item)
Adds a spatial item with an extent specified by the given
BoundingBoxDoubleGf to the index |
List<T> |
query(BoundingBox boundingBox)
Queries the index for all items whose extents intersect the given search
BoundingBoxDoubleGf
Note that some kinds of indexes may also return objects which do not in fact
intersect the query envelope. |
List<T> |
query(BoundingBox boundingBox,
Filter<T> filter) |
List<T> |
query(BoundingBox boundingBox,
String methodName,
Object... parameters) |
List<T> |
queryBoundingBox(Geometry geometry) |
boolean |
remove(BoundingBox boundingBox,
T item)
Removes a single item from the tree.
|
protected void |
setGeometryFactory(GeometryFactory geometryFactory) |
int |
size() |
void |
visit(BoundingBox boundingBox,
Visitor<T> visitor) |
void |
visitAll(Visitor<T> visitor) |
public QuadTree()
public QuadTree(GeometryFactory geometryFactory)
protected QuadTree(IdObjectNode<T> root)
public static double[] ensureExtent(double[] bounds,
double minExtent)
public void clear()
protected double[] convert(BoundingBox boundingBox)
public int depth()
public T getFirst(BoundingBox boundingBox, Filter<T> filter)
public GeometryFactory getGeometryFactory()
public int getSize()
public void insert(BoundingBox boundingBox, T item)
SpatialIndexBoundingBoxDoubleGf to the indexinsert in interface SpatialIndex<T>public List<T> query(BoundingBox boundingBox)
SpatialIndexBoundingBoxDoubleGf
Note that some kinds of indexes may also return objects which do not in fact
intersect the query envelope.query in interface SpatialIndex<T>boundingBox - the envelope to query forpublic List<T> query(BoundingBox boundingBox, Filter<T> filter)
public List<T> query(BoundingBox boundingBox, String methodName, Object... parameters)
public boolean remove(BoundingBox boundingBox, T item)
SpatialIndexremove in interface SpatialIndex<T>item - the item to removetrue if the item was foundprotected void setGeometryFactory(GeometryFactory geometryFactory)
public int size()
public void visit(BoundingBox boundingBox, Visitor<T> visitor)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.