index

package
v0.0.0-...-f4e3eaa Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxGeoTime helper to query into the future
	MaxGeoTime = time.Unix(0, math.MaxInt64)

	// MinGeoTime helper to query into the past
	MinGeoTime = time.Unix(0, 0)
)

Functions

This section is empty.

Types

type GeoID

type GeoID []byte

GeoID a key referring to a GeoData

type S2FlatIdx

type S2FlatIdx struct {
	store.KVStore
	// contains filtered or unexported fields
}

S2FlatIdx a flat S2 region cover index

func NewS2FlatIdx

func NewS2FlatIdx(s store.KVStore, prefix []byte, level int) *S2FlatIdx

NewS2FlatIdx returns a new indexer

func (*S2FlatIdx) Covering

func (idx *S2FlatIdx) Covering(gd *geodata.GeoData) (s2.CellUnion, error)

Covering is generating the cover of a GeoData

func (*S2FlatIdx) GeoIdsAtCell

func (idx *S2FlatIdx) GeoIdsAtCell(c s2.CellID) ([]GeoID, error)

GeoIdsAtCell returns all GeoData keys contained in the cell

func (*S2FlatIdx) GeoIdsAtCells

func (idx *S2FlatIdx) GeoIdsAtCells(cells []s2.CellID) ([]GeoID, error)

GeoIdsAtCells returns all GeoData keys contained in the cells, without duplicates

func (*S2FlatIdx) GeoIdsRadiusQuery

func (idx *S2FlatIdx) GeoIdsRadiusQuery(lat, lng, radius float64) ([]GeoID, error)

GeoIdsRadiusQuery returns the GeoID found in the index inside radius note you should check the returned GeoData is really inside/intersects the cap

func (*S2FlatIdx) GeoIndex

func (idx *S2FlatIdx) GeoIndex(gd *geodata.GeoData, id GeoID) error

GeoIndex is geo indexing the geo data it's not storing GeoData itself but only the geo index of the cover id is the key referring to the GeoData stored somewhere else

type S2FlatTimeIdx

type S2FlatTimeIdx struct {
	store.KVStore
	// contains filtered or unexported fields
}

S2FlatTimeIdx a flat S2 region cover time to index points & polygons

func NewS2FlatTimeIdx

func NewS2FlatTimeIdx(s store.KVStore, prefix []byte, level int) *S2FlatTimeIdx

NewS2FlatTimeIdx returns a new indexer

func (*S2FlatTimeIdx) Covering

func (idx *S2FlatTimeIdx) Covering(gd *geodata.GeoData) (s2.CellUnion, error)

Covering is generating the cover of a GeoData

func (*S2FlatTimeIdx) GeoTimeIdsAtCell

func (idx *S2FlatTimeIdx) GeoTimeIdsAtCell(c s2.CellID, from time.Time, to time.Time) ([]GeoID, error)

GeoTimeIdsAtCell returns all GeoData keys contained in the cell from time from to time to

func (*S2FlatTimeIdx) GeoTimeIdsAtCells

func (idx *S2FlatTimeIdx) GeoTimeIdsAtCells(cells []s2.CellID, from time.Time, to time.Time) ([]GeoID, error)

GeoTimeIdsAtCells returns all GeoData keys contained in the cells within time range, without duplicates

func (*S2FlatTimeIdx) GeoTimeIdsRadiusQuery

func (idx *S2FlatTimeIdx) GeoTimeIdsRadiusQuery(from time.Time, to time.Time, lat, lng float64, radius float64) ([]GeoID, error)

GeoTimeIdsRadiusQuery query over radius in meters within time range scan from future to past

func (*S2FlatTimeIdx) GeoTimeIdsRectQuery

func (idx *S2FlatTimeIdx) GeoTimeIdsRectQuery(from time.Time, to time.Time, urlat, urlng, bllat, bllng float64) ([]GeoID, error)

GeoTimeIdsRectQuery query over rect ur upper right bl bottom left scan from future to past

func (*S2FlatTimeIdx) GeoTimeIndex

func (idx *S2FlatTimeIdx) GeoTimeIndex(gd *geodata.GeoData, t time.Time, id GeoID) error

GeoTimeIndex is indexing the data by time and geo position it's not storing GeoData itself but only the geo index of the cover id is the key referring to the GeoData stored somewhere else it's meant to index geographical points or polygon attached to a time event could be a user position or an effect zone t is the time when the event end (can be in the future)

type S2PointIdx

type S2PointIdx struct {
	store.KVStore
	// contains filtered or unexported fields
}

S2PointIdx is an s2 point index

func NewS2PointIdx

func NewS2PointIdx(s store.KVStore, prefix []byte) *S2PointIdx

NewS2PointIdx returns a new indexer

func (*S2PointIdx) GeoIdsAtCell

func (idx *S2PointIdx) GeoIdsAtCell(c s2.CellID) ([]GeoID, error)

GeoIdsAtCell returns all GeoData keys contained in the cell

func (*S2PointIdx) GeoIdsAtCells

func (idx *S2PointIdx) GeoIdsAtCells(cells []s2.CellID) ([]GeoID, error)

GeoIdsAtCells returns all GeoData keys contained in the cells, without duplicates

func (*S2PointIdx) GeoIdsRadiusQuery

func (idx *S2PointIdx) GeoIdsRadiusQuery(lat, lng, radius float64) ([]GeoID, error)

GeoIdsRadiusQuery returns the GeoID found in the index inside radius

func (*S2PointIdx) GeoIdsRectQuery

func (idx *S2PointIdx) GeoIdsRectQuery(urlat, urlng, bllat, bllng float64) ([]GeoID, error)

GeoIdsRectQuery query over rect ur upper right bl bottom left

func (*S2PointIdx) GeoPointIndex

func (idx *S2PointIdx) GeoPointIndex(gd *geodata.GeoData, id GeoID) ([]byte, error)

GeoPointIndex is geo indexing the geo data point it's not storing GeoData itself but only the geo cell l30 of the point id is the key referring to the GeoData stored somewhere else

func (*S2PointIdx) GeoPointKey

func (idx *S2PointIdx) GeoPointKey(gd *geodata.GeoData, id GeoID) ([]byte, error)

GeoPointKey is returning the key generated for a geopoint + id

func (*S2PointIdx) PointIndex

func (idx *S2PointIdx) PointIndex(lat, lng float64, id GeoID) ([]byte, error)

PointIndex is geo indexing a point it's not storing GeoData itself but only the geo cell l30 of the point id is the key referring to the GeoData stored somewhere else

func (*S2PointIdx) PointKey

func (idx *S2PointIdx) PointKey(lat, lng float64, id GeoID) []byte

PointKey is returning the key generated for a position + id

Directories

Path Synopsis
Package geodata is a generated protocol buffer package.
Package geodata is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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