Class AbstractSTRtree<T, TItem>
Base class for STRtree and SIRtree. STR-packed R-trees are described in:
P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With
Application To GIS. Morgan Kaufmann, San Francisco, 2002.
This implementation is based on IBoundable<T, TItem>s rather than just AbstractNode<T, TItem>s,
because the STR algorithm operates on both nodes and
data, both of which are treated as IBoundable<T, TItem>s.
Inheritance
AbstractSTRtree<T, TItem>
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public abstract class AbstractSTRtree<T, TItem>
where T : IIntersectable<T>, IExpandable<T>
Type Parameters
Constructors
|
Improve this Doc
View Source
AbstractSTRtree(Int32)
Constructs an AbstractSTRtree with the specified maximum number of child
nodes that a node may have.
Declaration
protected AbstractSTRtree(int nodeCapacity)
Parameters
Type |
Name |
Description |
Int32 |
nodeCapacity |
|
|
Improve this Doc
View Source
AbstractSTRtree(Int32, AbstractNode<T, TItem>)
Constructs an AbstractSTRtree with the specified maximum number of child
nodes that a node may have, and the root node
Declaration
protected AbstractSTRtree(int nodeCapacity, AbstractNode<T, TItem> root)
Parameters
Type |
Name |
Description |
Int32 |
nodeCapacity |
The maximum number of child nodes in a node
|
AbstractNode<T, TItem> |
root |
The root node that links to all other nodes in the tree
|
|
Improve this Doc
View Source
AbstractSTRtree(Int32, IList<IBoundable<T, TItem>>)
Constructs an AbstractSTRtree with the specified maximum number of child
nodes that a node may have, and all leaf nodes in the tree
Declaration
protected AbstractSTRtree(int nodeCapacity, IList<IBoundable<T, TItem>> itemBoundables)
Parameters
Type |
Name |
Description |
Int32 |
nodeCapacity |
The maximum number of child nodes in a node
|
IList<IBoundable<T, TItem>> |
itemBoundables |
The list of leaf nodes in the tree
|
Properties
|
Improve this Doc
View Source
Count
Gets the number of elements in the tree
Declaration
public int Count { get; }
Property Value
|
Improve this Doc
View Source
Depth
Declaration
public int Depth { get; }
Property Value
|
Improve this Doc
View Source
IntersectsOp
Declaration
protected abstract AbstractSTRtree<T, TItem>.IIntersectsOp IntersectsOp { get; }
Property Value
Type |
Description |
AbstractSTRtree.IIntersectsOp<> |
A test for intersection between two bounds, necessary because subclasses
of AbstractSTRtree have different implementations of bounds.
|
|
Improve this Doc
View Source
IsEmpty
Tests whether the index contains any items.
This method does not build the index,
so items can still be inserted after it has been called.
Declaration
public bool IsEmpty { get; }
Property Value
|
Improve this Doc
View Source
ItemBoundables
Gets a value indicating the boundable items that have to be included in the index
Declaration
public IList<IBoundable<T, TItem>> ItemBoundables { get; }
Property Value
|
Improve this Doc
View Source
NodeCapacity
Gets the maximum number of child nodes that a node may have.
Declaration
public int NodeCapacity { get; }
Property Value
|
Improve this Doc
View Source
Root
Gets the root node of the tree.
Declaration
public AbstractNode<T, TItem> Root { get; protected set; }
Property Value
Methods
|
Improve this Doc
View Source
BoundablesAtLevel(Int32)
Declaration
protected IList<IBoundable<T, TItem>> BoundablesAtLevel(int level)
Parameters
Type |
Name |
Description |
Int32 |
level |
|
Returns
|
Improve this Doc
View Source
Build()
Creates parent nodes, grandparent nodes, and so forth up to the root
node, for the data that has been inserted into the tree. Can only be
called once, and thus can be called only after all of the data has been
inserted into the tree.
Declaration
|
Improve this Doc
View Source
CompareDoubles(Double, Double)
Declaration
protected static int CompareDoubles(double a, double b)
Parameters
Returns
|
Improve this Doc
View Source
CreateNode(Int32)
Declaration
protected abstract AbstractNode<T, TItem> CreateNode(int level)
Parameters
Type |
Name |
Description |
Int32 |
level |
|
Returns
|
Improve this Doc
View Source
CreateParentBoundables(IList<IBoundable<T, TItem>>, Int32)
Sorts the childBoundables then divides them into groups of size M, where
M is the node capacity.
Declaration
protected virtual IList<IBoundable<T, TItem>> CreateParentBoundables(IList<IBoundable<T, TItem>> childBoundables, int newLevel)
Parameters
Returns
|
Improve this Doc
View Source
GetComparer()
Declaration
protected abstract IComparer<IBoundable<T, TItem>> GetComparer()
Returns
|
Improve this Doc
View Source
GetDepth(AbstractNode<T, TItem>)
Declaration
protected int GetDepth(AbstractNode<T, TItem> node)
Parameters
Returns
|
Improve this Doc
View Source
GetSize(AbstractNode<T, TItem>)
Declaration
protected int GetSize(AbstractNode<T, TItem> node)
Parameters
Returns
|
Improve this Doc
View Source
Insert(T, TItem)
Declaration
protected void Insert(T bounds, TItem item)
Parameters
Type |
Name |
Description |
T |
bounds |
|
TItem |
item |
|
|
Improve this Doc
View Source
ItemsTree()
Gets a tree structure (as a nested list)
corresponding to the structure of the items and nodes in this tree.
The returned Lists contain either Object items,
or Lists which correspond to subtrees of the tree
Subtrees which do not contain any items are not included.
Builds the tree if necessary.
Declaration
public IList<object> ItemsTree()
Returns
Type |
Description |
IList<Object> |
a List of items and/or Lists
|
|
Improve this Doc
View Source
LastNode(IList<IBoundable<T, TItem>>)
Declaration
protected AbstractNode<T, TItem> LastNode(IList<IBoundable<T, TItem>> nodes)
Parameters
Returns
|
Improve this Doc
View Source
Query(T)
Also builds the tree, if necessary.
Declaration
protected IList<TItem> Query(T searchBounds)
Parameters
Type |
Name |
Description |
T |
searchBounds |
|
Returns
Type |
Description |
IList<TItem> |
|
|
Improve this Doc
View Source
Query(T, IItemVisitor<TItem>)
Declaration
protected void Query(T searchBounds, IItemVisitor<TItem> visitor)
Parameters
Type |
Name |
Description |
T |
searchBounds |
|
IItemVisitor<TItem> |
visitor |
|
|
Improve this Doc
View Source
Remove(T, TItem)
Removes an item from the tree.
(Builds the tree, if necessary.)
Declaration
protected bool Remove(T searchBounds, TItem item)
Parameters
Type |
Name |
Description |
T |
searchBounds |
|
TItem |
item |
|
Returns