Class SortedPackedIntervalRTree<T>
A static index on a set of 1-dimensional intervals, using an R-Tree packed based on the order of the interval midpoints.
Inherited Members
Namespace: NetTopologySuite.Index.IntervalRTree
Assembly: NetTopologySuite.dll
Syntax
public class SortedPackedIntervalRTree<T>
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
It supports range searching, where the range is an interval of the real line (which may be a single point). A common use is to index 1-dimensional intervals which are the projection of 2-D objects onto an axis of the coordinate system.
This index structure is static - items cannot be added or removed once the first query has been made. The advantage of this characteristic is that the index performance can be optimized based on a fixed set of items.
Methods
| Edit this page View SourceInsert(double, double, T)
Adds an item to the index which is associated with the given interval
Declaration
public void Insert(double min, double max, T item)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The lower bound of the item interval |
| double | max | The upper bound of the item interval |
| T | item | The item to insert |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | if the index has already been queried |
Query(double, double, IItemVisitor<T>)
Search for intervals in the index which intersect the given closed interval and apply the visitor to them.
Declaration
public void Query(double min, double max, IItemVisitor<T> visitor)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The lower bound of the query interval |
| double | max | The upper bound of the query interval |
| IItemVisitor<T> | visitor | The visitor to pass any matched items to |