Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MinMaxValueOfType ¶
func MinMaxValueOfType[T Coord](min, max *T)
MinMaxValueOfType returns the minimum and maximum value for the given numeric type T.
Types ¶
type Flatbush ¶
type Flatbush[T Coord] struct { NodeSize int // Minimum 2. Default 16 // contains filtered or unexported fields }
Flatbush is a spatial index for efficient 2D queries. The coordinates are one of *Coord*
func NewFlatbush ¶
Create a new Flatbush with one *Coord* type
func (*Flatbush[T]) Add ¶
Add a new box, and return its index. The index of the box is zero based, and corresponds 1:1 with the insertion of order of the boxes. You must add all boxes before calling Finish().
func (*Flatbush[T]) Finish ¶
func (f *Flatbush[T]) Finish()
Finish builds the spatial index, so that it can be queried.
func (*Flatbush[T]) SearchFast ¶
SearchFast accepts a 'results' as input. If you are performing millions of queries, then reusing a 'results' slice will reduce the number of allocations.
type MinMaxFloat32 ¶ added in v1.1.1
type MinMaxFloat64 ¶ added in v1.1.1
type MinMaxInt16 ¶ added in v1.1.1
type MinMaxInt32 ¶ added in v1.1.1
type MinMaxInt64 ¶ added in v1.1.1
type MinMaxInt8 ¶ added in v1.1.1
This method of using structs was a workaround for a bug in the Go 1.22 compiler/linker.