Documentation ¶
Overview ¶
Package types holds generic data models to represent objects used within mappyboi.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct { Time time.Time // GPS Coordinates. Latitude float64 Longitude float64 // Altitude above the WGS84 reference ellipsoid, in meters. Altitude int // Approximate accuracy radius of the location measurement, in meters. // A lower value means better precision. Accuracy int VerticalAccuracy int }
Location describes a single point in time and space. It is designed to be hashable, for equality comparisons (there is no point holding the same data twice!).
type LocationHistory ¶
type LocationHistory struct { Data []Location // Ordered by Time ASC. // contains filtered or unexported fields }
LocationHistory stores a structured set of location history.
func (*LocationHistory) Cleanup ¶
func (lh *LocationHistory) Cleanup() error
Cleanup performs cleanup operations on the data, including sorting.
func (*LocationHistory) Insert ¶
func (lh *LocationHistory) Insert(data ...Location)
Insert modifies the receiver LocationHistory object by combining it with the incoming Location objects. If at item with the same time already exists within the map, it will be skipped. To maintain chronological ordering, one must call .Cleanup() afterwards.