catTracks

package module
v0.0.0-...-e710698 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 49 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultEpsilon = 0.001
	DefaultLimit   = 1000
)

Variables

View Source
var FeaturePlaceChan = make(chan *geojson.Feature, 100000)
View Source
var NotifyNewEdge = make(chan bool, 1000)
View Source
var NotifyNewPlace = make(chan bool, 1000)

Functions

func BuildIndexBuckets

func BuildIndexBuckets() error

BuildIndexBuckets populates name, lat, and long buckets from main "tracks" (time) bucket.

func CalculateAndStoreStatsByDateAndSpanStepping

func CalculateAndStoreStatsByDateAndSpanStepping(t time.Time, spanStep, spanOverall time.Duration) error

NOTE: spanStep should be +, spanOverall can be +/- where '-' means backward-looking and '+' means forward looking relative to time t

func CloseGZ

func CloseGZ(f F)

func DeleteTestes

func DeleteTestes() error

DeleteTestes wipes the entire database of all points with names prefixed with testes prefix. Saves an rm keystorke

func ExportPostGIS

func ExportPostGIS()

func Float64bytesBig

func Float64bytesBig(float float64) []byte

func Float64frombytesBig

func Float64frombytesBig(bytes []byte) float64

func GetDB

func GetDB(name string) *bolt.DB

GetDB is db getter.

func GetMelody

func GetMelody() *melody.Melody

GetMelody does stuff

func GetQT

func GetQT() *quadtree.QuadTree

GetQT eturn QT, just like DB

func GetStats

func GetStats(t time.Time, d time.Duration) ([]byte, error)

func InitBoltDB

func InitBoltDB() error

InitBoltDB sets up initial stuff, like the file and necesary buckets

func InitMelody

func InitMelody()

InitMelody sets up the websocket handler which currently only handles the dilapidated QT (QuadTree) business. Can probably safely be removed.

func InitQT

func InitQT() error

InitQT initializes quadtree by iterating through all points and inserting them into in-memory (yikes!) qt

func NewQuery

func NewQuery() *query

func NewRouter

func NewRouter() *mux.Router

func RandStringRunes

func RandStringRunes(n int) string

func SetDBPath

func SetDBPath(whichdb, pathto string)

func SetDevopLock

func SetDevopLock(pathto string)

func SetEdgeLock

func SetEdgeLock(pathto string)

func SetForwardPopulate

func SetForwardPopulate(arguments string)

SetForwardPopulate sets the 'downstream' urls that should be forwarded any request that this client receives for populating points. Forward requests will be sent as POST requests in identical JSON as they are received. NOTE that forwardPopulate is a []string, so all uri's should be given in comma-separated format.

func SetLiveTracksGZ

func SetLiveTracksGZ(pathto string)

func SetLiveTracksGZDevop

func SetLiveTracksGZDevop(pathto string)

func SetLiveTracksGZEdge

func SetLiveTracksGZEdge(pathto string)

func SetMasterLock

func SetMasterLock(pathto string)

func SetPlacesLayer

func SetPlacesLayer(b bool)

func SetTestes

func SetTestes(flagOption bool)

SetTestes run

func TrackToFeature

func TrackToFeature(trackPointCurrent *trackPoint.TrackPoint) *geojson.Feature

func TrackToPlace

func TrackToPlace(tp *trackPoint.TrackPoint, visit note.NoteVisit) *geojson.Feature

Types

type F

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

func CreateGZ

func CreateGZ(s string, compressLevel int) (f F)

func (F) JE

func (f F) JE() *json.Encoder

type IftttBodyCatVisit

type IftttBodyCatVisit struct {
	Value1 string `json:"value1"`
	Value2 string `json:"value2"`
	Value3 int    `json:"value3"`
}

type LastKnown

type LastKnown map[string]*trackPoint.TrackPoint

type Metadata

type Metadata struct {
	KeyN               int
	KeyNUpdated        time.Time
	LastUpdatedAt      time.Time
	LastUpdatedBy      string
	LastUpdatedPointsN int
	TileDBLastUpdated  time.Time
}

type QueryFilterGoogleNearbyPhotos

type QueryFilterGoogleNearbyPhotos struct {
	PhotoReference string `schema:"photoreference"`
}

type QueryFilterPlaces

type QueryFilterPlaces struct {
	Uuids []string `schema:"uuids"`
	Names []string `schema:"names"`

	// start,end x arrive,depart,report
	StartArrivalT   time.Time `schema:"startArrivalT"`
	EndArrivalT     time.Time `schema:"endArrivalT"`
	StartDepartureT time.Time `schema:"startDepartureT"`
	EndDepartureT   time.Time `schema:"endDepartureT"`
	StartReportedT  time.Time `schema:"startReportedT"`
	EndReportedT    time.Time `schema:"endReportedT"`

	ReverseChrono bool `schema:"rc"` // when true, oldest first; default to newest first

	// paginatables
	StartIndex int `schema:"startI"` // 0 indexed;
	EndIndex   int `schema:"endI"`   // diff end-start = per/pagination lim

	// for geo rect bounding, maybe
	LatMin *float64 `schema:"latmin"`
	LatMax *float64 `schema:"latmax"`
	LngMin *float64 `schema:"lngmin"`
	LngMax *float64 `schema:"lngmax"`

	BoundingBoxSW []float64 `schema:"bboxSW"`
	BoundingBoxNE []float64 `schema:"bboxNE"`

	IncludeStats bool `schema:"stats,omitempty"`

	GoogleNearby       bool `schema:"googleNearby"`
	GoogleNearbyPhotos bool `schema:"googleNearbyPhotos"`
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type VisitsResponse

type VisitsResponse struct {
	Visits    []*note.NoteVisit `json:"visits"`
	Stats     bolt.BucketStats  `json"bucketStats,omitempty"`
	StatsTook time.Duration     `json:"statsTook,omitempty"` // how long took to get bucket stats (for 10mm++ points, long time)
	Scanned   int               `json:"scanned"`             // num visits checked before mtaching filters
	Matches   int               `json:"matches"`             // num visits matching before paging/index filters
}

Jump to

Keyboard shortcuts

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