intervalrtree

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Overview

Package intervalrtree a tree is an R-tree index for one-dimensional intervals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchNode

type BranchNode struct {
	*IRNode
	// contains filtered or unexported fields
}

BranchNode define interval R-tree branch node.

func NewBranchNode

func NewBranchNode(n1, n2 Node) *BranchNode

NewBranchNode ...

func (*BranchNode) Query

func (in *BranchNode) Query(queryMin, queryMax float64, visitor index.ItemVisitor)

Query Search for intervals in the index which intersect the given closed interval and apply the visitor to them.

type IRNode

type IRNode struct {
	// contains filtered or unexported fields
}

IRNode define interval R-tree node.

func (*IRNode) IsIntersects

func (in *IRNode) IsIntersects(queryMin, queryMax float64) bool

IsIntersects ...

func (*IRNode) Max

func (in *IRNode) Max() float64

Max return r-tree max.

func (*IRNode) Min

func (in *IRNode) Min() float64

Min return r-tree max.

func (*IRNode) Query

func (in *IRNode) Query(queryMin, queryMax float64, visitor index.ItemVisitor)

Query Search for intervals in the index which intersect the given closed interval and apply the visitor to them.

type LeafNode

type LeafNode struct {
	*IRNode
	// contains filtered or unexported fields
}

LeafNode define interval R-tree leaf node.

func (*LeafNode) Query

func (in *LeafNode) Query(queryMin, queryMax float64, visitor index.ItemVisitor)

Query Search for intervals in the index which intersect the given closed interval and apply the visitor to them.

type LeafNodes

type LeafNodes []Node

LeafNodes ...

func (LeafNodes) Len

func (l LeafNodes) Len() int

Len ...

func (LeafNodes) Less

func (l LeafNodes) Less(i, j int) bool

Less ...

func (LeafNodes) Swap

func (l LeafNodes) Swap(i, j int)

Swap ...

type Node

type Node interface {
	Max() float64
	Min() float64
	Query(queryMin, queryMax float64, visitor index.ItemVisitor)
}

Node define Node interface

type SortedPackedIntervalRTree

type SortedPackedIntervalRTree struct {
	// contains filtered or unexported fields
}

SortedPackedIntervalRTree A static index on a set of 1-dimensional intervals,

using an R-Tree packed based on the order of the interval midpoints.
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.

func (*SortedPackedIntervalRTree) Insert

func (s *SortedPackedIntervalRTree) Insert(queryEnv *envelope.Envelope, item interface{}) error

Insert Adds an item to the index which is associated with the given interval

func (*SortedPackedIntervalRTree) Query

func (s *SortedPackedIntervalRTree) Query(queryEnv *envelope.Envelope) interface{}

Query Search for intervals in the index which intersect the given closed interval and apply the visitor to them.

func (*SortedPackedIntervalRTree) QueryVisitor

func (s *SortedPackedIntervalRTree) QueryVisitor(queryEnv *envelope.Envelope, visitor index.ItemVisitor) error

QueryVisitor Search for intervals in the index which intersect the given closed interval and apply the visitor to them.

func (*SortedPackedIntervalRTree) Remove

func (s *SortedPackedIntervalRTree) Remove(itemEnv *envelope.Envelope, item interface{}) bool

Remove Removes a single item from the tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL