Search Results for

    Show / Hide Table of Contents

    Class HPRtree<T>

    A Hilbert-Packed R-tree. This is a static R-tree which is packed by using the Hilbert ordering of the tree items.

    The tree is constructed by sorting the items by the Hilbert code of the midpoint of their envelope. Then, a set of internal layers is created recursively as follows:
    • The items/nodes of the previous are partitioned into blocks of size nodeCapacity
    • For each block a layer node is created with range equal to the envelope of the items/nodess in the block
    The internal layers are stored using an array to store the node bounds. The link between a node and its children is stored implicitly in the indexes of the array. For efficiency, the offsets to the layers within the node array are pre-computed and stored.

    NOTE: Based on performance testing, the HPRtree is somewhat faster than the STRtree. It should also be more memory-efficent, due to fewer object allocations.

    However, it is not clear whether this will produce a significant improvement for use in JTS operations.
    Inheritance
    object
    HPRtree<T>
    Implements
    ISpatialIndex<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Index.HPRtree
    Assembly: NetTopologySuite.dll
    Syntax
    public class HPRtree<T> : ISpatialIndex<T>
    Type Parameters
    Name Description
    T

    Constructors

    | Edit this page View Source

    HPRtree()

    Creates a new index with the default node capacity.

    Declaration
    public HPRtree()
    | Edit this page View Source

    HPRtree(int)

    Creates a new index with the given node capacity.

    Declaration
    public HPRtree(int nodeCapacity)
    Parameters
    Type Name Description
    int nodeCapacity

    The node capacity to use

    Properties

    | Edit this page View Source

    Count

    Gets the number of items in the index.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    The number of items

    Methods

    | Edit this page View Source

    Build()

    Builds the index, if not already built.

    Declaration
    public void Build()
    | Edit this page View Source

    GetBounds()

    Gets the extents of the internal index nodes

    Declaration
    public Envelope[] GetBounds()
    Returns
    Type Description
    Envelope[]

    A list of the internal node extents

    | Edit this page View Source

    Insert(Envelope, T)

    Adds a spatial item with an extent specified by the given Envelope to the index.

    Declaration
    public void Insert(Envelope itemEnv, T item)
    Parameters
    Type Name Description
    Envelope itemEnv
    T item
    | Edit this page View Source

    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.

    Declaration
    public IList<T> Query(Envelope searchEnv)
    Parameters
    Type Name Description
    Envelope searchEnv

    The envelope to query for.

    Returns
    Type Description
    IList<T>

    A list of the items found by the query.

    | Edit this page View Source

    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.

    Declaration
    public void Query(Envelope searchEnv, IItemVisitor<T> visitor)
    Parameters
    Type Name Description
    Envelope searchEnv

    The envelope to query for.

    IItemVisitor<T> visitor

    A visitor object to apply to the items found.

    | Edit this page View Source

    Remove(Envelope, T)

    Removes a single item from the tree.

    Declaration
    public bool Remove(Envelope itemEnv, T item)
    Parameters
    Type Name Description
    Envelope itemEnv

    The Envelope of the item to remove.

    T item

    The item to remove.

    Returns
    Type Description
    bool

    true if the item was found.

    Remarks

    Not supported, will always return false

    Implements

    ISpatialIndex<T>

    See Also

    STRtree<TItem>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX