Documentation
¶
Index ¶
Constants ¶
const EARTHRADIUS = 6371
EARTHRADIUS is the Earth's radius 6,371km. ref: https://en.wikipedia.org/wiki/Earth_radius
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DGPSStation ¶
type DGPSStation int
DGPSStation is the representation a differential GPS station. (0 <= value <= 1023)
type Degrees ¶
type Degrees float64
Degrees is used for bearing, heading, course. Units are decimal degrees, true (not magnetic). (0.0 <= value < 360.0)
type Extensions ¶
type Extensions struct {
XML []byte `xml:",innerxml"`
}
Extensions is the representation extension.
type Fix ¶
type Fix string
Fix is the representation type of GPS fix. none means GPS had no fix. To signify "the fix info is unknown, leave out fixType entirely. pps = military signal used (value comes from list: {'none'|'2d'|'3d'|'dgps'|'pps'})
type GPX ¶
type GPX struct { XMLName string `xml:"gpx"` Creator string `xml:"creator,attr,omitempty"` Version string `xml:"version,attr,omitempty"` Metadata *MetaData `xml:"metadata,omitempty"` Tracks []Track `xml:"trk,omitempty"` }
GPX is the representation gpxType.
func (*GPX) Elevations ¶
Elevations returns all the track point elevation.
func (*GPX) GetCoordinates ¶
GetCoordinates return all track points latitude and longitude.
func (*GPX) MinAndMixElevation ¶
MinAndMixElevation returns min and mix elevation.
type Link ¶
type Link struct { XMLName xml.Name `xml:"link"` URL string `xml:"href,attr,omitempty"` Text string `xml:"text,omitempty"` Type string `xml:"type,omitempty"` }
Link is an external resource (Web page, digital photo, video clip, etc) with additional information.
type MetaData ¶
MetaData is the information about the GPX file, author, and copyright restrictions goes in the metadata section.
type Track ¶
type Track struct { XMLName xml.Name `xml:"trk"` Name string `xml:"name,omitempty"` Comment string `xml:"cmt,omitempty"` Description string `xml:"desc,omitempty"` Source string `xml:"src,omitempty"` Links []Link `xml:"link,omitempty"` Number int `xml:"number,omitempty"` Type string `xml:"type,omitempty"` Extensions *Extensions `xml:"extensions,omitempty"` TrackSegments []TrackSegment `xml:"trkseg,omitempty"` }
Track is the representation trk - an ordered list of points describing a path.
type TrackPointExtension ¶
type TrackPointExtension struct { XMLName xml.Name `xml:"TrackPointExtension"` Temperature float64 `xml:"atemp,omitempty"` WTemperature float64 `xml:"wtemp,omitempty"` Depth float64 `xml:"depth,omitempty"` HeartRate int `xml:"hr,omitempty"` Cadence int `xml:"cad,omitempty"` }
TrackPointExtension tracks temperature, heart rate and cadence specific to devices
type TrackPointExtensions ¶
type TrackPointExtensions struct { XMLName xml.Name `xml:"extensions"` TrackPointExtensions *TrackPointExtension `xml:"TrackPointExtension,omitempty"` }
TrackPointExtensions extend GPX by adding your own elements from another schema
type TrackSegment ¶
type TrackSegment struct { XMLName xml.Name `xml:"trkseg"` TrackPoint []WayPoint `xml:"trkpt"` Extensions *Extensions `xml:"extensions,omitempty"` }
TrackSegment holds a list of TrackPoint which are logically connected in order.
type WayPoint ¶
type WayPoint struct { XMLName xml.Name `xml:"trkpt"` Latitude float64 `xml:"lat,attr"` Longitude float64 `xml:"lon,attr"` Elevation float64 `xml:"ele,omitempty"` Timestamp string `xml:"time,omitempty"` MagneticVariation Degrees `xml:"magvar,omitempty"` GeoIDHeight float64 `xml:"geoidheight,omitempty"` Name string `xml:"name,omitempty"` Comment string `xml:"cmt,omitempty"` Description string `xml:"desc,omitempty"` Source string `xml:"src,omitempty"` Links []Link `xml:"link,omitempty"` Symbol string `xml:"sym,omitempty"` Type string `xml:"type,omitempty"` Fix Fix `xml:"fix,omitempty"` Sat int `xml:"sat,omitempty"` HorizontalDilutionOfPrecision float64 `xml:"hdop,omitempty"` VerticalDilutionOfPrecision float64 `xml:"vdop,omitempty"` PositionDilutionOfPrecision float64 `xml:"pdop,omitempty"` AgeOfGpsData float64 `xml:"ageofgpsdata,omitempty"` DifferentialGPSID DGPSStation `xml:"dgpsid,omitempty"` Extensions *TrackPointExtensions `xml:"extensions,omitempty"` }
WayPoint is a point of interest, or named feature on a map.
func (*WayPoint) Distance ¶
Distance returns two point distance. ref: https://www.movable-type.co.uk/scripts/latlong.html