data

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const NoGAN = -3
View Source
const NoSignal = 99

Variables

View Source
var (
	NoGANColor     = color.RGBA{R: 0, G: 0, B: 0, A: 255}
	GANMinus2Color = color.RGBA{R: 139, G: 0, B: 0, A: 255}
	GANMinus1Color = color.RGBA{R: 220, G: 20, B: 60, A: 255}
	GAN0Color      = color.RGBA{R: 255, G: 140, B: 0, A: 255}
	GAN1Color      = color.RGBA{R: 255, G: 215, B: 0, A: 255}
	GAN2Color      = color.RGBA{R: 154, G: 205, B: 50, A: 255}
	GAN3Color      = color.RGBA{R: 34, G: 139, B: 34, A: 255}
	GAN4Color      = color.RGBA{R: 0, G: 100, B: 0, A: 255}
)
View Source
var NoPosition = Position{}
View Source
var ZeroDataPoint = DataPoint{}

Functions

func DataPointToCSV

func DataPointToCSV(dataPoint DataPoint) string

func DataPointToJSON

func DataPointToJSON(dataPoint DataPoint) string

func GANToColor added in v1.2.0

func GANToColor(gan int) color.Color

func IsCSVLine

func IsCSVLine(line string) bool

func IsJSONLine

func IsJSONLine(line string) bool

func IsUsableRSSI added in v1.2.0

func IsUsableRSSI(rssi int) bool

func MapByMeasurement added in v1.1.0

func MapByMeasurement(dataPoints []DataPoint) map[string][]DataPoint

func MapByUTMField added in v1.1.0

func MapByUTMField(dataPoints []DataPoint) map[string][]DataPoint

func ParseDecOrHex

func ParseDecOrHex(s string) (uint32, error)

func RSSIToGAN

func RSSIToGAN(rssi int) int

func ReadLines

func ReadLines(in io.Reader) ([]string, error)

func SortRSSI added in v1.1.0

func SortRSSI(rssi1, rssi2, alt int) int

Types

type CellInfo

type CellInfo struct {
	LAC     uint32
	Carrier uint32
	RSSI    int
	Cx      int
}

type DataPoint

type DataPoint struct {
	Latitude   float64   `json:"lat"`
	Longitude  float64   `json:"lon"`
	Satellites int       `json:"sats"`
	Timestamp  time.Time `json:"ts"`
	LAC        uint32    `json:"lac"`
	Carrier    uint32    `json:"carrier"`
	RSSI       int       `json:"rssi"`
	Cx         int       `json:"cx"`
}

func ParseCSVLine

func ParseCSVLine(line string) (DataPoint, error)

func ParseJSONLine

func ParseJSONLine(line string) (DataPoint, error)

func ReadDataPoints

func ReadDataPoints(in io.Reader) ([]DataPoint, error)

func SortByRSSI added in v1.1.0

func SortByRSSI(dataPoints []DataPoint) []DataPoint

func SortByTimestamp

func SortByTimestamp(dataPoints []DataPoint) []DataPoint

func (DataPoint) IsUsable added in v1.2.0

func (dp DataPoint) IsUsable() bool

func (DataPoint) IsValid

func (dp DataPoint) IsValid() bool

func (DataPoint) IsZero

func (dp DataPoint) IsZero() bool

func (DataPoint) MeasurementID added in v1.1.0

func (dp DataPoint) MeasurementID() string

func (DataPoint) UTMField added in v1.1.0

func (dp DataPoint) UTMField() UTMField

type Filter

type Filter interface {
	Filter(dataPoints []DataPoint) []DataPoint
}

func FilterBestServer

func FilterBestServer() Filter

func FilterByCarrier added in v1.2.0

func FilterByCarrier(carrier uint32) Filter

func FilterByLAC

func FilterByLAC(lac uint32) Filter

type FilterFunc

type FilterFunc func(dataPoints []DataPoint) []DataPoint

func (FilterFunc) Filter

func (f FilterFunc) Filter(dataPoints []DataPoint) []DataPoint

type Position added in v1.2.0

type Position struct {
	Latitude   float64
	Longitude  float64
	Satellites int
	Timestamp  time.Time
}

func (Position) ToUTMField added in v1.2.0

func (p Position) ToUTMField() UTMField

type UTMField added in v1.1.0

type UTMField struct {
	East   float64
	North  float64
	Zone   int
	Letter string
}

func NewUTMField added in v1.1.0

func NewUTMField(lat float64, lon float64) UTMField

func (UTMField) Area added in v1.1.0

func (f UTMField) Area() (minLat float64, minLon float64, maxLat float64, maxLon float64)

func (UTMField) FieldID added in v1.1.0

func (f UTMField) FieldID() string

func (UTMField) String added in v1.1.0

func (f UTMField) String() string

Jump to

Keyboard shortcuts

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