Table of Contents

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 Envelope
item 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 Envelope

The 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 Envelope

The 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 Envelope

The Envelope of the item to remove.

item T

The item to remove.

Returns

bool

true if the item was found.