Versions in this module Expand all Collapse all v1 v1.0.0 May 21, 2023 Changes in this version + func AngleFromNorth(loc1, loc2 Point, radians bool) float64 + func CalcMaxSpeed(speedsDistances []SpeedsAndDistances) float64 + func CalcUphillDownhill(elevations []NullableFloat64) (float64, float64) + func Distance2D(lat1, lon1, lat2, lon2 float64, haversine bool) float64 + func Distance3D(lat1, lon1 float64, ele1 NullableFloat64, lat2, lon2 float64, ...) float64 + func ElevationAngle(loc1, loc2 Point, radians bool) float64 + func GetGpxElementInfo(prefix string, gpxDoc GPXElementInfo) string + func HaversineDistance(lat1, lon1, lat2, lon2 float64) float64 + func Length2D(locs []Point) float64 + func Length3D(locs []Point) float64 + func ToRad(x float64) float64 + func ToXml(g *GPX, params ToXmlParams) ([]byte, error) + type ElevationBounds struct + MaxElevation float64 + MinElevation float64 + func (b *ElevationBounds) String() string + func (b ElevationBounds) Equals(b2 ElevationBounds) bool + type Extension struct + Nodes []ExtensionNode + func (ex *Extension) GetNode(namespaceURL NamespaceURL, path0 string) (node *ExtensionNode, found bool) + func (ex *Extension) GetOrCreateNode(namespaceURL NamespaceURL, path ...string) *ExtensionNode + func (ex Extension) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type ExtensionNode struct + Attrs []xml.Attr + Data string + Nodes []ExtensionNode + XMLName xml.Name + func (n *ExtensionNode) GetAttr(key string) (value string, found bool) + func (n *ExtensionNode) GetNode(path0 string) (node *ExtensionNode, found bool) + func (n *ExtensionNode) GetOrCreateNode(path ...string) *ExtensionNode + func (n *ExtensionNode) SetAttr(key, value string) + func (n ExtensionNode) GetAttrOrEmpty(attr string) string + func (n ExtensionNode) IsEmpty() bool + func (n ExtensionNode) LocalName() string + func (n ExtensionNode) SpaceNameURL() string + type GPX struct + Attrs GPXAttributes + AuthorEmail string + AuthorLink string + AuthorLinkText string + AuthorLinkType string + AuthorName string + Copyright string + CopyrightLicense string + CopyrightYear string + Creator string + Description string + Extensions Extension + Keywords string + Link string + LinkText string + LinkType string + Name string + Routes []GPXRoute + Time *time.Time + Tracks []GPXTrack + Version string + Waypoints []GPXPoint + XMLNs string + XmlNsXsi string + XmlSchemaLoc string + func Parse(inReader io.Reader) (*GPX, error) + func ParseBytes(buf []byte) (*GPX, error) + func ParseFile(fileName string) (*GPX, error) + func ParseString(str string) (*GPX, error) + func (g *GPX) AddElevation(elevation float64) + func (g *GPX) AddMissingTime() + func (g *GPX) AppendPoint(p *GPXPoint) + func (g *GPX) AppendRoute(r *GPXRoute) + func (g *GPX) AppendSegment(s *GPXTrackSegment) + func (g *GPX) AppendTrack(t *GPXTrack) + func (g *GPX) AppendWaypoint(w *GPXPoint) + func (g *GPX) Bounds() GpxBounds + func (g *GPX) Duration() float64 + func (g *GPX) ElevationBounds() ElevationBounds + func (g *GPX) ExecuteOnAllPoints(executor func(*GPXPoint)) + func (g *GPX) ExecuteOnRoutePoints(executor func(*GPXPoint)) + func (g *GPX) ExecuteOnTrackPoints(executor func(*GPXPoint)) + func (g *GPX) ExecuteOnWaypoints(executor func(*GPXPoint)) + func (g *GPX) GetGpxInfo() string + func (g *GPX) GetLocationPositionsOnTrack(samples int, location Location) []float64 + func (g *GPX) GetLocationsPositionsOnTrack(samples int, locations ...Location) [][]float64 + func (g *GPX) GetTrackPointsNo() int + func (g *GPX) HasTimes() bool + func (g *GPX) Length2D() float64 + func (g *GPX) Length3D() float64 + func (g *GPX) MovingData() MovingData + func (g *GPX) PositionAt(t time.Time) []TrackPosition + func (g *GPX) ReduceGpxToSingleTrack() + func (g *GPX) ReduceTrackPoints(maxPointsNo int, minDistanceBetween float64) + func (g *GPX) RegisterNamespace(ns, url string) + func (g *GPX) RemoveElevation() + func (g *GPX) RemoveEmpty() + func (g *GPX) RemoveHorizontalExtremes() + func (g *GPX) RemoveVerticalExtremes() + func (g *GPX) SimplifyTracks(maxDistance float64) + func (g *GPX) SmoothHorizontal() + func (g *GPX) SmoothVertical() + func (g *GPX) Split(trackNo, segNo, pointNo int) + func (g *GPX) StoppedPositions() []TrackPosition + func (g *GPX) TimeBounds() TimeBounds + func (g *GPX) ToXml(params ToXmlParams) ([]byte, error) + func (g *GPX) UpdateDistance() + func (g *GPX) UphillDownhill() UphillDownhill + type GPXAttributes struct + NamespaceAttributes map[string]map[string]NamespaceAttribute + func NewGPXAttributes(attrs []xml.Attr) GPXAttributes + func (ga *GPXAttributes) GetNamespaceAttrs() map[string]NamespaceAttribute + func (ga *GPXAttributes) RegisterNamespace(ns, url string) + func (ga GPXAttributes) ToXMLAttrs() (namespacesReplacement string, replacements map[string]string) + type GPXElementInfo interface + Bounds func() GpxBounds + GetTrackPointsNo func() int + Length2D func() float64 + Length3D func() float64 + MovingData func() MovingData + TimeBounds func() TimeBounds + UphillDownhill func() UphillDownhill + type GPXPoint struct + AgeOfDGpsData NullableFloat64 + Comment string + DGpsId NullableInt + Description string + Extensions Extension + GeoidHeight string + HorizontalDilution NullableFloat64 + MagneticVariation string + Name string + PositionalDilution NullableFloat64 + Satellites NullableInt + Source string + Symbol string + Timestamp time.Time + Type string + TypeOfGpsFix string + VerticalDilution NullableFloat64 + func (pt *GPXPoint) MaxDilutionOfPrecision() float64 + func (pt *GPXPoint) SpeedBetween(pt2 *GPXPoint, threeD bool) float64 + func (pt *GPXPoint) TimeDiff(pt2 *GPXPoint) float64 + type GPXRoute struct + Comment string + Description string + Extensions Extension + Name string + Number NullableInt + Points []GPXPoint + Source string + Type string + func (rte *GPXRoute) Center() (float64, float64) + func (rte *GPXRoute) ExecuteOnPoints(executor func(*GPXPoint)) + func (rte *GPXRoute) Length() float64 + type GPXTrack struct + Comment string + Description string + Extensions Extension + Name string + Number NullableInt + Segments []GPXTrackSegment + Source string + Type string + func (g *GPXTrack) UpdateDistance(startingDistance float64) float64 + func (trk *GPXTrack) AddElevation(elevation float64) + func (trk *GPXTrack) AddMissingTime() + func (trk *GPXTrack) AppendSegment(s *GPXTrackSegment) + func (trk *GPXTrack) Bounds() GpxBounds + func (trk *GPXTrack) Duration() float64 + func (trk *GPXTrack) ElevationBounds() ElevationBounds + func (trk *GPXTrack) ExecuteOnPoints(executor func(*GPXPoint)) + func (trk *GPXTrack) GetTrackPointsNo() int + func (trk *GPXTrack) HasTimes() bool + func (trk *GPXTrack) Join(segNo, segNo2 int) + func (trk *GPXTrack) JoinNext(segNo int) + func (trk *GPXTrack) Length2D() float64 + func (trk *GPXTrack) Length3D() float64 + func (trk *GPXTrack) MovingData() MovingData + func (trk *GPXTrack) PositionAt(t time.Time) []TrackPosition + func (trk *GPXTrack) ReduceTrackPoints(minDistance float64) + func (trk *GPXTrack) RemoveHorizontalExtremes() + func (trk *GPXTrack) RemoveVerticalExtremes() + func (trk *GPXTrack) SimplifyTracks(maxDistance float64) + func (trk *GPXTrack) SmoothHorizontal() + func (trk *GPXTrack) SmoothVertical() + func (trk *GPXTrack) Split(segNo, ptNo int) + func (trk *GPXTrack) StoppedPositions() []TrackPosition + func (trk *GPXTrack) TimeBounds() TimeBounds + func (trk *GPXTrack) UphillDownhill() UphillDownhill + type GPXTrackSegment struct + Extensions Extension + Points []GPXPoint + func (g *GPXTrackSegment) UpdateDistance(startingDistance float64) float64 + func (seg *GPXTrackSegment) AddElevation(elevation float64) + func (seg *GPXTrackSegment) AddMissingTime() + func (seg *GPXTrackSegment) AppendPoint(p *GPXPoint) + func (seg *GPXTrackSegment) Bounds() GpxBounds + func (seg *GPXTrackSegment) Duration() float64 + func (seg *GPXTrackSegment) ElevationBounds() ElevationBounds + func (seg *GPXTrackSegment) Elevations() []NullableFloat64 + func (seg *GPXTrackSegment) ExecuteOnPoints(executor func(*GPXPoint)) + func (seg *GPXTrackSegment) GetTrackPointsNo() int + func (seg *GPXTrackSegment) HasTimes() bool + func (seg *GPXTrackSegment) Join(seg2 *GPXTrackSegment) + func (seg *GPXTrackSegment) Length2D() float64 + func (seg *GPXTrackSegment) Length3D() float64 + func (seg *GPXTrackSegment) MovingData() MovingData + func (seg *GPXTrackSegment) PositionAt(t time.Time) int + func (seg *GPXTrackSegment) ReduceTrackPoints(minDistance float64) + func (seg *GPXTrackSegment) RemoveHorizontalExtremes() + func (seg *GPXTrackSegment) RemoveVerticalExtremes() + func (seg *GPXTrackSegment) SimplifyTracks(maxDistance float64) + func (seg *GPXTrackSegment) SmoothHorizontal() + func (seg *GPXTrackSegment) SmoothVertical() + func (seg *GPXTrackSegment) Speed(pointIdx int) float64 + func (seg *GPXTrackSegment) Split(pt int) (*GPXTrackSegment, *GPXTrackSegment) + func (seg *GPXTrackSegment) StoppedPositions() []TrackPosition + func (seg *GPXTrackSegment) TimeBounds() TimeBounds + func (seg *GPXTrackSegment) UphillDownhill() UphillDownhill + type GpxBounds struct + MaxLatitude float64 + MaxLongitude float64 + MinLatitude float64 + MinLongitude float64 + func (b *GpxBounds) String() string + func (b GpxBounds) Equals(b2 GpxBounds) bool + type Location interface + GetElevation func() NullableFloat64 + GetLatitude func() float64 + GetLongitude func() float64 + type MovingData struct + MaxSpeed float64 + MovingDistance float64 + MovingTime float64 + StoppedDistance float64 + StoppedTime float64 + func (md MovingData) Equals(md2 MovingData) bool + type NamespaceAttribute struct + type NamespaceURL string + const AnyNamespace + const NoNamespace + type NullableFloat64 struct + func NewNullableFloat64(data float64) *NullableFloat64 + func (n *NullableFloat64) IsNotNaN() bool + func (n *NullableFloat64) NotNull() bool + func (n *NullableFloat64) Null() bool + func (n *NullableFloat64) SetNull() + func (n *NullableFloat64) SetValue(data float64) + func (n *NullableFloat64) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (n *NullableFloat64) UnmarshalXMLAttr(attr xml.Attr) error + func (n *NullableFloat64) Value() float64 + func (n NullableFloat64) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (n NullableFloat64) MarshalXMLAttr(name xml.Name) (xml.Attr, error) + type NullableInt struct + func NewNullableInt(data int) *NullableInt + func (n *NullableInt) NotNull() bool + func (n *NullableInt) Null() bool + func (n *NullableInt) SetNull() + func (n *NullableInt) SetValue(data int) + func (n *NullableInt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (n *NullableInt) UnmarshalXMLAttr(attr xml.Attr) error + func (n *NullableInt) Value() int + func (n NullableInt) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (n NullableInt) MarshalXMLAttr(name xml.Name) (xml.Attr, error) + type NullableString struct + func NewNullableString(data string) *NullableString + func (n *NullableString) NotNull() bool + func (n *NullableString) Null() bool + func (n *NullableString) SetNull() + func (n *NullableString) SetValue(data string) + func (n *NullableString) Value() string + type NullableTime struct + func NewNullableTime(data time.Time) *NullableTime + func (n *NullableTime) NotNull() bool + func (n *NullableTime) Null() bool + func (n *NullableTime) SetNull() + func (n *NullableTime) SetValue(data time.Time) + func (n *NullableTime) Value() time.Time + type Point struct + Distance float64 + Elevation NullableFloat64 + Latitude float64 + Longitude float64 + func (pt *Point) Distance2D(pt2 Location) float64 + func (pt *Point) Distance3D(pt2 Location) float64 + func (pt *Point) GetElevation() NullableFloat64 + func (pt *Point) GetLatitude() float64 + func (pt *Point) GetLongitude() float64 + func (pt Point) Add(latDelta, lonDelta, eleDelta float64) Point + type SpeedsAndDistances struct + Distance float64 + Speed float64 + type TimeBounds struct + EndTime time.Time + StartTime time.Time + func (tb *TimeBounds) String() string + func (tb TimeBounds) Equals(tb2 TimeBounds) bool + type ToXmlParams struct + Indent bool + Version string + type TrackPosition struct + PointNo int + SegmentNo int + TrackNo int + type UphillDownhill struct + Downhill float64 + Uphill float64 + func (ud UphillDownhill) Equals(ud2 UphillDownhill) bool