Package org.locationtech.jts.index
Interface SpatialIndex
-
public interface SpatialIndex
The basic operations supported by classes implementing spatial index algorithms.A spatial index typically provides a primary filter for range rectangle queries. A secondary filter is required to test for exact intersection. The secondary filter may consist of other kinds of tests, such as testing other spatial relationships.
- Version:
- 1.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
insert(Envelope itemEnv, java.lang.Object item)
Adds a spatial item with an extent specified by the givenEnvelope
to the indexjava.util.List
query(Envelope searchEnv)
Queries the index for all items whose extents intersect the given searchEnvelope
Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.void
query(Envelope searchEnv, ItemVisitor visitor)
Queries the index for all items whose extents intersect the given searchEnvelope
, and applies anItemVisitor
to them.boolean
remove(Envelope itemEnv, java.lang.Object item)
Removes a single item from the tree.
-
-
-
Method Detail
-
insert
void insert(Envelope itemEnv, java.lang.Object item)
Adds a spatial item with an extent specified by the givenEnvelope
to the index
-
query
java.util.List query(Envelope searchEnv)
Queries the index for all items whose extents intersect the given searchEnvelope
Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.- Parameters:
searchEnv
- the envelope to query for- Returns:
- a list of the items found by the query
-
query
void query(Envelope searchEnv, ItemVisitor visitor)
Queries the index for all items whose extents intersect the given searchEnvelope
, and applies anItemVisitor
to them. Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.- Parameters:
searchEnv
- the envelope to query forvisitor
- a visitor object to apply to the items found
-
remove
boolean remove(Envelope itemEnv, java.lang.Object item)
Removes a single item from the tree.- Parameters:
itemEnv
- the Envelope of the item to removeitem
- the item to remove- Returns:
true
if the item was found
-
-