Documentation ¶
Index ¶
- type FenceIndex
- type GeoFence
- type GeoFenceType
- type MutexFenceIndex
- func (m *MutexFenceIndex) Add(name string, feature *geo.Feature) error
- func (m *MutexFenceIndex) Get(name string) GeoFence
- func (m *MutexFenceIndex) Keys() []string
- func (m *MutexFenceIndex) Search(name string, c geo.Coordinate) ([]*geo.Feature, error)
- func (m *MutexFenceIndex) Set(name string, fence GeoFence)
- type UnsafeFenceIndex
- func (u *UnsafeFenceIndex) Add(name string, feature *geo.Feature) (err error)
- func (u *UnsafeFenceIndex) Get(name string) (fence GeoFence)
- func (u *UnsafeFenceIndex) Keys() (keys []string)
- func (u *UnsafeFenceIndex) Search(name string, c geo.Coordinate) (matchs []*geo.Feature, err error)
- func (u *UnsafeFenceIndex) Set(name string, fence GeoFence)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FenceIndex ¶
type FenceIndex interface { // Set the GeoFence Set(name string, fence GeoFence) // Get the GeoFence at the key, return nil if doesn't exist Get(name string) GeoFence // Add a feature to the GeoFence at the key Add(name string, feature *geo.Feature) error // Search for the coordinate at the key Search(name string, c geo.Coordinate) ([]*geo.Feature, error) // List the keys of the indexed fences Keys() []string }
FenceIndex is a dictionary of multiple fences. Useful if you have multiple data sets that need to be searched
func LoadFenceIndex ¶
func LoadFenceIndex(fenceType GeoFenceType, resolution int, fenceName string, geoJsonString *string) (fences FenceIndex, err error)
type GeoFence ¶
type GeoFenceType ¶
type GeoFenceType string
const ( GeoFenceTypeS2 GeoFenceType = "s2" GeoFenceTypeBbox GeoFenceType = "bbox" GeoFenceTypeBrute GeoFenceType = "brute" GeoFenceTypeRtree GeoFenceType = "rtree" )
type MutexFenceIndex ¶
func NewMutexFenceIndex ¶
func NewMutexFenceIndex() *MutexFenceIndex
func (*MutexFenceIndex) Add ¶
func (m *MutexFenceIndex) Add(name string, feature *geo.Feature) error
func (*MutexFenceIndex) Get ¶
func (m *MutexFenceIndex) Get(name string) GeoFence
func (*MutexFenceIndex) Keys ¶
func (m *MutexFenceIndex) Keys() []string
func (*MutexFenceIndex) Search ¶
func (m *MutexFenceIndex) Search(name string, c geo.Coordinate) ([]*geo.Feature, error)
func (*MutexFenceIndex) Set ¶
func (m *MutexFenceIndex) Set(name string, fence GeoFence)
type UnsafeFenceIndex ¶
type UnsafeFenceIndex struct {
// contains filtered or unexported fields
}
func NewUnsafeFenceIndex ¶
func NewUnsafeFenceIndex() *UnsafeFenceIndex
func (*UnsafeFenceIndex) Add ¶
func (u *UnsafeFenceIndex) Add(name string, feature *geo.Feature) (err error)
func (*UnsafeFenceIndex) Get ¶
func (u *UnsafeFenceIndex) Get(name string) (fence GeoFence)
func (*UnsafeFenceIndex) Keys ¶
func (u *UnsafeFenceIndex) Keys() (keys []string)
func (*UnsafeFenceIndex) Search ¶
func (u *UnsafeFenceIndex) Search(name string, c geo.Coordinate) (matchs []*geo.Feature, err error)
func (*UnsafeFenceIndex) Set ¶
func (u *UnsafeFenceIndex) Set(name string, fence GeoFence)
Click to show internal directories.
Click to hide internal directories.