Interface ISpatialIndex<T>
- Namespace
- NetTopologySuite.Index
- Assembly
- NetTopologySuite.dll
The basic insertion and query 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. Of course, this secondary filter may consist of other tests besides intersection, such as testing other kinds of spatial relationships.
public interface ISpatialIndex<T>
Type Parameters
T
Methods
Insert(Envelope, T)
Adds a spatial item with an extent specified by the given Envelope
to the index.
void Insert(Envelope itemEnv, T item)
Parameters
itemEnv
Envelopeitem
T
Query(Envelope)
Queries the index for all items whose extents intersect the given search Envelope
Note that some kinds of indexes may also return objects which do not in fact
intersect the query envelope.
IList<T> Query(Envelope searchEnv)
Parameters
searchEnv
EnvelopeThe envelope to query for.
Returns
- IList<T>
A list of the items found by the query.
Query(Envelope, IItemVisitor<T>)
Queries the index for all items whose extents intersect the given search Envelope, and applies an IItemVisitor<T> to them. Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.
void Query(Envelope searchEnv, IItemVisitor<T> visitor)
Parameters
searchEnv
EnvelopeThe envelope to query for.
visitor
IItemVisitor<T>A visitor object to apply to the items found.
Remove(Envelope, T)
Removes a single item from the tree.
bool Remove(Envelope itemEnv, T item)
Parameters
itemEnv
EnvelopeThe Envelope of the item to remove.
item
TThe item to remove.
Returns
- bool
true
if the item was found.