Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultDegree int = 10
Variables ¶
This section is empty.
Functions ¶
func GeodeticBoxDist ¶
GeodeticBoxDist returns the distance in meters between the point and rect
func PlanarBoxDist ¶
PlanarBoxDist returns the squared distance between the given point and rect
Types ¶
type HilbertBuilder ¶
type HilbertBuilder struct {
// contains filtered or unexported fields
}
func NewHilbertBuilder ¶
func NewHilbertBuilder() *HilbertBuilder
func (*HilbertBuilder) Add ¶
func (b *HilbertBuilder) Add(ref int64, minX, minY, maxX, maxY float64)
type OMTBuilder ¶
type OMTBuilder struct {
// contains filtered or unexported fields
}
func NewOMTBuilder ¶
func NewOMTBuilder() *OMTBuilder
func (*OMTBuilder) Add ¶
func (b *OMTBuilder) Add(ref int64, minX, minY, maxX, maxY float64)
type RTree ¶
type RTree struct {
// contains filtered or unexported fields
}
func Deserialize ¶
func (*RTree) Neighbors ¶
func (r *RTree) Neighbors( x, y float64, iterf func(ref int64, dist float64) (next bool), boxDist func(pX, pY, minX, minY, maxX, maxY float64) (dist float64), itemDist func(pX, pY float64, ref int64) (dist float64), )
Neighbors calls the iterf function for all items in ascending order of distance to the given coordinates. If iterf returns false the search will terminate.
Distances are calculated with the boxDist function. The itemDist function can optionally be supplied to calculate a more accurate distance to items in the index. Take care that itemDist and boxDist return distances in the same units.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.