geoidx

package module
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: CC0-1.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type EventType `json:"type"`
	Obj  *Object   `json:"obj"`
}

type EventType

type EventType int
const (
	EventTypeSet EventType = iota
	EventTypeDelete
)

type Filter added in v1.2.0

type Filter func(obj *Object) bool

type FilterList added in v1.2.0

type FilterList []Filter

type Index

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

func NewIndex

func NewIndex() *Index

func (*Index) Delete

func (i *Index) Delete(obj *Object)

func (*Index) DeleteNoNotify

func (i *Index) DeleteNoNotify(obj *Object)

func (*Index) GetObjectByID

func (i *Index) GetObjectByID(id string) *Object

func (*Index) SearchByObject

func (i *Index) SearchByObject(obj *Object, filters ...Filter) []*Object

func (*Index) SearchByObjectID

func (i *Index) SearchByObjectID(id string, filters ...Filter) []*Object

func (*Index) SearchByRect

func (i *Index) SearchByRect(rect Rect, filters ...Filter) []*Object

func (*Index) Subscribe

func (i *Index) Subscribe(chSize int) *Subscription

func (*Index) Unsubscribe

func (i *Index) Unsubscribe(sub *Subscription)

func (*Index) Upsert

func (i *Index) Upsert(obj *Object)

func (*Index) UpsertNoNotify

func (i *Index) UpsertNoNotify(obj *Object)

type Object

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

func NewObject

func NewObject(id string, bounds Rect, val interface{}) *Object

func (*Object) Bounds

func (o *Object) Bounds() *rtreego.Rect

func (*Object) ID

func (o *Object) ID() string

func (*Object) Value

func (o *Object) Value() interface{}

type Point

type Point struct {
	Latitude  float64 `json:"lat"`
	Longitude float64 `json:"lng"`
}

type Rect

type Rect struct {
	SouthWest Point `json:"sw"`
	NorthEast Point `json:"ne"`
}

func MakeRect

func MakeRect(minX, minY, maxX, maxY float64) Rect

func (*Rect) ToRTreeRect

func (r *Rect) ToRTreeRect() *rtreego.Rect

type Subscription

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

func (*Subscription) Events

func (s *Subscription) Events() <-chan Event

func (*Subscription) ID added in v1.0.5

func (s *Subscription) ID() string

func (*Subscription) SetBounds

func (s *Subscription) SetBounds(bounds Rect)

func (*Subscription) SetFilters added in v1.0.2

func (s *Subscription) SetFilters(filters ...Filter)

func (*Subscription) TrackID added in v1.1.0

func (s *Subscription) TrackID(id string)

func (*Subscription) UntrackID added in v1.1.0

func (s *Subscription) UntrackID(id string)

Jump to

Keyboard shortcuts

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