rtred

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 3 Imported by: 6

README

RTree implementation for Go

GoDoc

This package provides an in-memory R-Tree implementation for Go, useful as a spatial data structure. It has support for 1-20 dimensions, and can store and search multidimensions interchangably in the same tree.

Authors

  • 1983 Original algorithm and test code by Antonin Guttman and Michael Stonebraker, UC Berkely
  • 1994 ANCI C ported from original test code by Melinda Green
  • 1995 Sphere volume fix for degeneracy problem submitted by Paul Brook
  • 2004 Templated C++ port by Greg Douglas
  • 2016 Go port by Josh Baker
  • 2018 Added kNN and merged in some of the RBush logic by Vladimir Agafonkin

License

RTree source code is available under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item interface {
	Rect(ctx interface{}) (min []float64, max []float64)
}

type Iterator

type Iterator func(item Item) bool

type RTree

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

func New

func New(ctx interface{}) *RTree

func (*RTree) Count

func (tr *RTree) Count() int

func (*RTree) Insert

func (tr *RTree) Insert(item Item)

func (*RTree) KNN

func (tr *RTree) KNN(bounds Item, center bool, iter func(item Item, dist float64) bool)

func (*RTree) Remove

func (tr *RTree) Remove(item Item)

func (*RTree) Reset

func (tr *RTree) Reset()

func (*RTree) Search

func (tr *RTree) Search(bounds Item, iter Iterator)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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