Documentation
¶
Overview ¶
Package hprtree a hprtree is a spatial index structure . This is a static R-tree which is packed by using the Hilbert ordering of the tree items.
Index ¶
- Constants
- type HPRTree
- func (h *HPRTree) Insert(itemEnv *envelope.Envelope, item interface{}) error
- func (h *HPRTree) Query(searchEnv *envelope.Envelope) interface{}
- func (h *HPRTree) QueryVisitor(searchEnv *envelope.Envelope, visitor index.ItemVisitor) error
- func (h *HPRTree) Remove(itemEnv *envelope.Envelope, item interface{}) bool
- func (h *HPRTree) Size() int
- type HilbertEncoder
- type Item
- type ItemComparator
Constants ¶
const ( EnvSize = 4 HilbertLevel = 12 DefaultNodeCapacity = 16 )
HPRTree const parameter.
const MaxLevel = 16
MaxLevel ...
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HPRTree ¶
type HPRTree struct { Items []interface{} // contains filtered or unexported fields }
HPRTree 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.
func (*HPRTree) Insert ¶
Insert Adds a spatial item with an extent specified by the given Envelope to the index
func (*HPRTree) Query ¶
Query 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.
func (*HPRTree) QueryVisitor ¶
QueryVisitor Queries the index for all items whose extents intersect the given search Envelope, and applies an ItemVisitor to them. Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.
type HilbertEncoder ¶
type HilbertEncoder struct {
// contains filtered or unexported fields
}
HilbertEncoder ...
func NewHilbertEncoder ¶
func NewHilbertEncoder(level int, extent *envelope.Envelope) *HilbertEncoder
NewHilbertEncoder ...
type ItemComparator ¶
type ItemComparator struct {
// contains filtered or unexported fields
}
ItemComparator sort items by HilbertEncoder