Documentation
¶
Overview ¶
Package generic gives a set of generic structs and functions for geodata manipulations. It is used to process geodata in a universal format, regardless of the source of this data.
Index ¶
Constants ¶
const ( Proto = "proto" Odometer = "odometer" Satellites = "sats" HDOP = "hdop" VDOP = "vdop" PDOP = "pdop" Move = "move" DigInput = "dinput" DigOutput = "doutput" AnInput = "ainput" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AxisWGS84 ¶
type AxisWGS84 struct {
Coordinate float64
Cardinal CardinalAxis
}
AxisWGS84 is the WGS84 axis of a coordinate system.
func ParseAxisWGS84 ¶
func ParseAxisWGS84(coord string, c CardinalAxis) (AxisWGS84, error)
ParseAxisWGS84 parses a string into a AxisWGS84.
type CardinalAxis ¶
type CardinalAxis string
CardinalAxis is the cardinal axis of a coordinate system.
const ( North CardinalAxis = "N" South CardinalAxis = "S" East CardinalAxis = "E" West CardinalAxis = "W" )
func ParseCardinalAxis ¶
func ParseCardinalAxis(raw string) (cp CardinalAxis, err error)
ParseCardinalAxis parses a string into a CardinalAxis.
func (CardinalAxis) Sign ¶
func (c CardinalAxis) Sign() float64
Sign returns the floating point sign of the coordinate.
type Cellular ¶
type Cellular struct {
// CellID - CID, CI - A GSM Cell ID
CellID int64
// LAC - Location Area Code
LAC int64
// MCC - Mobile Country Code
MCC int64
// MNC - Mobile Network Code
MNC int64
}
Cellular is a generic cellular struct.
type Location ¶
type Location struct {
geom.Coordinates
Valid bool
}
Location is a generic location struct.
type PointWGS84 ¶
PointWGS84 is the WGS84 point of a coordinate system.
func ParsePointWGS84 ¶
func ParsePointWGS84(lon string, cardLon CardinalAxis, lat string, cardLat CardinalAxis) (PointWGS84, error)
ParsePointWGS84 parses a pair string lon/lat into a PointWGS84.
func (PointWGS84) LocationXY ¶
func (w PointWGS84) LocationXY() Location
LocationXY is the XY location of a coordinate system.
func (PointWGS84) LocationXYZ ¶
func (w PointWGS84) LocationXYZ(z float64) Location
LocationXYZ is the XYZ location of a coordinate system.
type Position ¶
type Position struct {
Location
Cellular *Cellular
Protocol string
DeviceID string
Attributes protocol.Attributes
DeviceTime time.Time
Speed null.Float
Course null.Float
}
Position is a generic position struct.
func (Position) MarshalZerologObject ¶
MarshalZerologObject implements zerolog.LogObjectMarshaler.