24 lines
551 B
Go
24 lines
551 B
Go
|
package traccar
|
||
|
|
||
|
import "git.fjla.uk/fred.boniface/map-dots/data"
|
||
|
|
||
|
func MapToPositionData(positions []Positions) []data.LocationData {
|
||
|
var locationDataList []data.LocationData
|
||
|
|
||
|
for _, pos := range positions {
|
||
|
speedInMph := int(pos.Speed * 1.15078)
|
||
|
// Unsure of the accuracy of the speed data
|
||
|
|
||
|
locationData := data.LocationData{
|
||
|
Latitude: pos.Latitude,
|
||
|
Longitude: pos.Longitude,
|
||
|
Speed: uint32(speedInMph),
|
||
|
Altitude: pos.Altitude,
|
||
|
}
|
||
|
|
||
|
locationDataList = append(locationDataList, locationData)
|
||
|
}
|
||
|
|
||
|
return locationDataList
|
||
|
}
|