rtree

package
v0.0.0-...-1bbc218 Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: ISC Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	MaxEntries:  9,
	Transformer: nil,
}

Functions

func TransformLonLatElevToXYZ_Sphere

func TransformLonLatElevToXYZ_Sphere(min, max [3]float64) (minOut, maxOut [3]float64)

func TransformLonLatElevToXYZ_WGS84

func TransformLonLatElevToXYZ_WGS84(min, max [3]float64) (minOut, maxOut [3]float64)

Types

type Options

type Options struct {
	MaxEntries  int
	Transformer func(minIn, maxIn [3]float64) (minOut, maxOut [3]float64)
}

type RTree

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

func New

func New(opts *Options) *RTree

func (*RTree) Bounds

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

func (*RTree) Count

func (tr *RTree) Count() int

func (*RTree) Insert

func (tr *RTree) Insert(item pair.Pair)

func (*RTree) KNN

func (tr *RTree) KNN(x, y, z float64, iter func(item pair.Pair, dist float64) bool) bool

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

func (*RTree) Load

func (tr *RTree) Load(items []pair.Pair)

Load bulk loads items. For now it only loads each item one at a time. In the future it should use the OMT algorithm.

func (*RTree) Remove

func (tr *RTree) Remove(item pair.Pair)

func (*RTree) SavePNG

func (tr *RTree) SavePNG(path string, width, height int, scale float64, showNodes bool, withGIF bool, printer io.Writer) error

func (*RTree) Scan

func (tr *RTree) Scan(iter func(item pair.Pair) bool) bool

func (*RTree) Search

func (tr *RTree) Search(bbox pair.Pair, iter func(item pair.Pair) bool) bool

func (*RTree) Traverse

func (tr *RTree) Traverse(iter func(min, max [3]float64, level int, item pair.Pair) bool)

Jump to

Keyboard shortcuts

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