Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultDegree int = 16
Variables ¶
This section is empty.
Functions ¶
func GeoBoxDist ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func (*Index) Neighbors ¶
func (index *Index) Neighbors( x, y float64, boxDist func(pX, pY, minX, minY, maxX, maxY float64) (dist float64), iterf func(i int, dist float64) (next bool), )
Neighbors calls the iterf function on the nearest neighbors to the target point, according to the given boxDist function. Terminate the search by returning false from iterf.
func (*Index) NeighborsByItemDist ¶
func (index *Index) NeighborsByItemDist( x, y float64, boxDist func(pX, pY, minX, minY, maxX, maxY float64) (dist float64), itemDist func(pX, pY float64, i int) (dist float64), iterf func(i int, dist float64) (next bool), )
NeighborsByItemDist takes a second distance function that calculates the distance from the target to an item, rather than its bounding box. This can give a more accurate nearest neighbors ordering. Item distances must have the same unit as box distances.
Click to show internal directories.
Click to hide internal directories.