trackPoint

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

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(lat1, lon1, lat2, lon2 float64) float64

Distance function returns the distance (in meters) between two points of

a given longitude and latitude relatively accurately (using a spherical
approximation of the Earth) through the Haversin Distance Formula for
great arc distance on a sphere with accuracy for small distances

point coordinates are supplied in degrees and converted into rad. in the func

distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula

Types

type CatStats

type CatStats struct {
	Speed     DotStats `json:"speed_stats"`
	Elevation DotStats `json:"elevation_stats"`
	Distance  float64  `json:"distance"`
	Count     int      `json:"count"`
}

CatStats

type DotStats

type DotStats struct {
	Max  float64 `json:"max"`
	Min  float64 `json:"min"`
	Mean float64 `json:"mean"`
}

DotStats

type TPs

type TPs []*TrackPoint

TPs has comm

func (TPs) Len

func (slice TPs) Len() int

TrackPoints will implement all the methods required to satisfy the sort.Interface interface

func (TPs) Less

func (slice TPs) Less(i, j int) bool

func (TPs) Swap

func (slice TPs) Swap(i, j int)

type TrackPoint

type TrackPoint struct {
	Uuid            string    `json:"uuid"`
	PushToken       string    `json:"pushToken"`
	Version         string    `json:"version"`
	ID              int64     `json:"id"` // either bolt auto id or unixnano //think nano is better cuz can check for dupery
	Name            string    `json:"name"`
	Lat             float64   `json:"lat"`
	Lng             float64   `json:"long"`
	Accuracy        float64   `json:"accuracy"`       // horizontal, in meters
	VAccuracy       float64   `json:"vAccuracy"`      // vertical, in meteres
	Elevation       float64   `json:"elevation"`      // in meters
	Speed           float64   `json:"speed"`          // in kilometers per hour
	SpeedAccuracy   float64   `json:"speed_accuracy"` // in meters per second
	Tilt            float64   `json:"tilt"`           // degrees?
	Heading         float64   `json:"heading"`        // in degrees
	HeadingAccuracy float64   `json:"heading_accuracy"`
	HeartRate       float64   `json:"heartrate"` // bpm
	Time            time.Time `json:"time"`
	Floor           int       `json:"floor"` // building floor if available
	Notes           string    `json:"notes"` // special events of the day
	COVerified      bool      `json:"COVerified"`
	RemoteAddr      string    `json:"remoteaddr"`
}

TrackPoint Stores a snippet of life, love, and location

func (*TrackPoint) Scale

func (p *TrackPoint) Scale(val float64) simpleline.Point

Scale does deepry

func (*TrackPoint) String

func (p *TrackPoint) String() string

func (*TrackPoint) Subtract

func (p *TrackPoint) Subtract(p2 simpleline.Point) simpleline.Point

Subtract add depee

func (*TrackPoint) Vector

func (p *TrackPoint) Vector() []float64

Vector deepens

func (*TrackPoint) Zero

func (p *TrackPoint) Zero() simpleline.Point

Zero is more deep

type TrackPoints

type TrackPoints []*TrackPoint

TrackPoints is plural. might implement Len method for Sortabliilty

func (TrackPoints) ForName

func (points TrackPoints) ForName(name string) (catpoints TrackPoints)

ForName returns all points in a given set belonging to a given name.

func (TrackPoints) Len

func (slice TrackPoints) Len() int

TrackPoints will implement all the methods required to satisfy the sort.Interface interface

func (TrackPoints) Less

func (slice TrackPoints) Less(i, j int) bool

func (TrackPoints) Since

func (points TrackPoints) Since(when time.Time) (catpoints TrackPoints)

Since return all points from a group after a given time.

func (TrackPoints) Statistics

func (points TrackPoints) Statistics() (stats CatStats)

Statistics pull stats for a given set of TrackPoints

func (TrackPoints) Swap

func (slice TrackPoints) Swap(i, j int)

func (TrackPoints) UniqueNames

func (points TrackPoints) UniqueNames() (names []string)

GetUniqueNames yep

func (TrackPoints) Unverified

func (tps TrackPoints) Unverified(r *http.Request)

func (TrackPoints) Verified

func (tps TrackPoints) Verified()

Jump to

Keyboard shortcuts

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