Documentation ¶
Index ¶
- Variables
- type Location
- type Namespace
- type QuadTree
- type Stats
- type TreeNode
- type World
- func (m *World) Delete(ns string, locId string)
- func (m *World) GetLocation(ns string, id string) (Location, bool)
- func (m *World) Merge(w *World)
- func (m *World) QueryRange(ns string, lat1, lat2, lon1, lon2 float64) []*Location
- func (m *World) Save(ns string, locId string, lat float64, lon float64) error
- func (m *World) ToBytes() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocationErrorRequiredId = errors.New("location id is required") LocationErrorInvalidLatitude = errors.New("invalid latitude") LocationErrorInvalidLongitude = errors.New("invalid longitude") LocationErrorRequiredNamespace = errors.New("namespace is required") )
View Source
var ( TreeErrLocationNil = errors.New("insertion failed because location is nil") TreeErrLocationOutOfBounds = errors.New("insertion failed because location is out of bounds") )
View Source
var (
NamespaceErrorNotFound = errors.New("namespace not found")
)
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct { Node *TreeNode // contains filtered or unexported fields }
func NewLocation ¶
type Namespace ¶
type Namespace struct { Name string // contains filtered or unexported fields }
func NewNamespace ¶
func (*Namespace) DeleteLocation ¶
func (*Namespace) QueryRange ¶
type TreeNode ¶
type TreeNode struct { NE *TreeNode NW *TreeNode SE *TreeNode SW *TreeNode Lat1 float64 Lat2 float64 Lon1 float64 Lon2 float64 Objects map[string]*Location Capacity int IsDivided bool // contains filtered or unexported fields }
func NewTreeNode ¶
func (*TreeNode) ForceDivide ¶
type World ¶
type World struct {
// contains filtered or unexported fields
}
func NewWorldFromBytes ¶
func (*World) QueryRange ¶
Click to show internal directories.
Click to hide internal directories.