base

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RTree

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

RTree is an R-tree

func New

func New(dims, maxEntries int) *RTree

New creates a new R-tree

func (*RTree) Bounds

func (tr *RTree) Bounds() (min, max []float64)

Bounds returns the bounding box of the entire R-tree

func (*RTree) Complexity

func (tr *RTree) Complexity() float64

Complexity returns the complexity of the R-tree. The higher the value, the more complex the tree. The value of 1 is the lowest.

func (*RTree) Count

func (tr *RTree) Count() int

Count returns the number of items in the R-tree.

func (*RTree) Insert

func (tr *RTree) Insert(min, max []float64, item interface{})

Insert inserts an item

func (*RTree) IsEmpty

func (tr *RTree) IsEmpty() bool

func (*RTree) KNN

func (tr *RTree) KNN(min, max []float64, center bool, iter func(item interface{}, dist float64) bool) bool

KNN returns items nearest to farthest. The dist param is the "box distance".

func (*RTree) Load

func (tr *RTree) Load(mins, maxs [][]float64, items []interface{})

Load bulk load items into the R-tree.

func (*RTree) Remove

func (tr *RTree) Remove(min, max []float64, item interface{})

Remove removes an item from the R-tree.

func (*RTree) Scan

func (tr *RTree) Scan(iter func(item interface{}) bool) bool

Scan iterates over the entire R-tree

func (*RTree) Search

func (tr *RTree) Search(min, max []float64, iter func(item interface{}) bool) bool

Search searches the tree for items in the input rectangle

func (*RTree) Traverse

func (tr *RTree) Traverse(iter func(min, max []float64, level int, item interface{}) bool) bool

Traverse iterates over the entire R-tree and includes all nodes and items.

Jump to

Keyboard shortcuts

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