index

package
v0.0.0-...-0108d89 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlexItem

type FlexItem struct {
	MinX, MinY, MaxX, MaxY float64
}

FlexItem can represent a point or a rectangle

func (*FlexItem) Point

func (item *FlexItem) Point() (x, y float64)

Point returns the point

func (*FlexItem) Rect

func (item *FlexItem) Rect() (minX, minY, maxX, maxY float64)

Rect returns the rectangle

type Index

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

Index is a geospatial index

func New

func New() *Index

New create a new index

func (*Index) Bounds

func (ix *Index) Bounds() (MinX, MinY, MaxX, MaxY float64)

Bounds returns the minimum bounding rectangle of all items in the index.

func (*Index) Count

func (ix *Index) Count() int

Count counts all items in the index.

func (*Index) Insert

func (ix *Index) Insert(item Item)

Insert inserts an item into the index

func (*Index) KNN

func (ix *Index) KNN(x, y float64, iterator func(item interface{}) bool) bool

func (*Index) Remove

func (ix *Index) Remove(item Item)

Remove removed an item from the index

func (*Index) RemoveAll

func (ix *Index) RemoveAll()

RemoveAll removes all items from the index.

func (*Index) Search

func (ix *Index) Search(minX, minY, maxX, maxY float64,
	iterator func(item interface{}) bool,
) bool

Search returns all items that intersect the bounding box.

type Item

type Item interface {
	Point() (x, y float64)
	Rect() (minX, minY, maxX, maxY float64)
}

Item represents an index item.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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