types

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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