Documentation ¶
Index ¶
- 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
- type GPX
- 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) 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) UphillDownhill() UphillDownhill
- type GPXElementInfo
- type GPXPoint
- type GPXRoute
- type GPXTrack
- 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
- 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
- type Location
- type MovingData
- type NullableFloat64
- func (n NullableFloat64) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (n NullableFloat64) MarshalXMLAttr(name xml.Name) (xml.Attr, error)
- 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
- type NullableInt
- func (n NullableInt) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (n NullableInt) MarshalXMLAttr(name xml.Name) (xml.Attr, error)
- 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
- type NullableString
- type NullableTime
- type Point
- type SpeedsAndDistances
- type TimeBounds
- type ToXmlParams
- type TrackPosition
- type UphillDownhill
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcMaxSpeed ¶
func CalcMaxSpeed(speedsDistances []SpeedsAndDistances) float64
CalcMaxSpeed returns the maximum speed
func CalcUphillDownhill ¶
func CalcUphillDownhill(elevations []NullableFloat64) (float64, float64)
CalcUphillDownhill calculates uphill and downhill from given elevations
func Distance2D ¶
Distance2D calculates the distance of 2 geo coordinates
func Distance3D ¶
func Distance3D(lat1, lon1 float64, ele1 NullableFloat64, lat2, lon2 float64, ele2 NullableFloat64, haversine bool) float64
Distance3D calculates the distance of 2 geo coordinates including elevation distance
func ElevationAngle ¶
ElevationAngle calculates the elevation angle (steepness) between to points
func GetGpxElementInfo ¶
func GetGpxElementInfo(prefix string, gpxDoc GPXElementInfo) string
GetGpxElementInfo pretty prints some basic information about this GPX elements
func HaversineDistance ¶
HaversineDistance returns the haversine distance between two points.
Implemented from http://www.movable-type.co.uk/scripts/latlong.html
Types ¶
type ElevationBounds ¶
ElevationBounds contains max/min elevation
func (ElevationBounds) Equals ¶
func (b ElevationBounds) Equals(b2 ElevationBounds) bool
Equals returns true if two Bounds objects are equal
func (*ElevationBounds) String ¶
func (b *ElevationBounds) String() string
String implements Stringer interface
type GPX ¶
type GPX struct { XMLNs string XmlNsXsi string XmlSchemaLoc string Version string Creator string Name string Description string AuthorName string AuthorEmail string AuthorLink string AuthorLinkText string AuthorLinkType string Copyright string CopyrightYear string CopyrightLicense string Link string LinkText string LinkType string Time *time.Time Keywords string // TODO //Extensions []byte Waypoints []GPXPoint Routes []GPXRoute Tracks []GPXTrack }
GPX implements one or multiple GPS tracks that can be written to and parsed from a gpx file
func (*GPX) AddElevation ¶
AddElevation adds elevation on all points (pointElevation = pointElevation + elevation)
func (*GPX) AppendPoint ¶
AppendPoint appends a point to the end of the last segment of the last track. If no track or segment exists empty ones will be added.
func (*GPX) AppendSegment ¶
func (g *GPX) AppendSegment(s *GPXTrackSegment)
AppendSegment appends a segment on the end of the last track. If the track does not exist an empty one will be created and added.
func (*GPX) AppendWaypoint ¶
AppendWaypoint adds a waypoint
func (*GPX) ElevationBounds ¶
func (g *GPX) ElevationBounds() ElevationBounds
ElevationBounds returns the min and max elevation of all tracks
func (*GPX) ExecuteOnAllPoints ¶
ExecuteOnAllPoints executes given function on all points
func (*GPX) ExecuteOnRoutePoints ¶
ExecuteOnRoutePoints executes given function on route points
func (*GPX) ExecuteOnTrackPoints ¶
ExecuteOnTrackPoints executes given function on track points
func (*GPX) ExecuteOnWaypoints ¶
ExecuteOnWaypoints executes given function on waypoints
func (*GPX) GetGpxInfo ¶
GetGpxInfo pretty prints some basic information about this GPX, its track and segments
func (*GPX) GetLocationPositionsOnTrack ¶
GetLocationPositionsOnTrack gets position of a single point on the track. TODO: remove following restriction by implementing a caching option Always use GetLocationsPositionsOnTrack(...) for multiple points, it is faster.
func (*GPX) GetLocationsPositionsOnTrack ¶
GetLocationsPositionsOnTrack finds locations candidates where this location is on a track. Returns an array of distances from start for every given location. Used (for example) for positioning waypoints on the graph. The bigger the samples number the more granular the search will be. For example if samples is 100 then (cca) every 100th point will be searched. This is for tracks with thousands of waypoints -- computing distances for each and every point is slow.
func (*GPX) GetTrackPointsNo ¶
GetTrackPointsNo returns the amount of track points of all tracks
func (*GPX) HasTimes ¶
HasTimes Checks if *tracks* and segments have time information. Routes and Waypoints are ignored.
func (*GPX) MovingData ¶
func (g *GPX) MovingData() MovingData
MovingData returns the moving data for all tracks in a Gpx.
func (*GPX) PositionAt ¶
func (g *GPX) PositionAt(t time.Time) []TrackPosition
PositionAt returns a LocationResultsPair consisting the segment index and the GpxWpt at a certain time.
func (*GPX) ReduceGpxToSingleTrack ¶
func (g *GPX) ReduceGpxToSingleTrack()
ReduceGpxToSingleTrack combines all tracks to a single track
func (*GPX) ReduceTrackPoints ¶
ReduceTrackPoints reduces the number of track points of all tracks
func (*GPX) RemoveElevation ¶
func (g *GPX) RemoveElevation()
RemoveElevation removes elevation info on all points
func (*GPX) RemoveEmpty ¶
func (g *GPX) RemoveEmpty()
RemoveEmpty removes all a) segments without points and b) tracks without segments
func (*GPX) RemoveHorizontalExtremes ¶
func (g *GPX) RemoveHorizontalExtremes()
RemoveHorizontalExtremes removes horizontal extremes
func (*GPX) RemoveVerticalExtremes ¶
func (g *GPX) RemoveVerticalExtremes()
RemoveVerticalExtremes removes vertical extremes
func (*GPX) SimplifyTracks ¶
SimplifyTracks does Ramer-Douglas-Peucker algorithm for simplification of polyline on all tracks
func (*GPX) SmoothHorizontal ¶
func (g *GPX) SmoothHorizontal()
SmoothHorizontal smoothes all tracks horizontally
func (*GPX) SmoothVertical ¶
func (g *GPX) SmoothVertical()
SmoothVertical smoothes all tracks vertically
func (*GPX) StoppedPositions ¶
func (g *GPX) StoppedPositions() []TrackPosition
StoppedPositions returns the positions where there was a stop
func (*GPX) TimeBounds ¶
func (g *GPX) TimeBounds() TimeBounds
TimeBounds returns the time bounds of all tacks in a Gpx.
func (*GPX) ToXml ¶
func (g *GPX) ToXml(params ToXmlParams) ([]byte, error)
ToXml converts the object to xml. Params are optional, you can set null to use GPXs Version and no indentation.
func (*GPX) UphillDownhill ¶
func (g *GPX) UphillDownhill() UphillDownhill
UphillDownhill returns uphill and downhill values for all tracks in a Gpx.
type GPXElementInfo ¶
type GPXElementInfo interface { Length2D() float64 Length3D() float64 Bounds() GpxBounds MovingData() MovingData UphillDownhill() UphillDownhill TimeBounds() TimeBounds GetTrackPointsNo() int }
GPXElementInfo implements some basic stats all common GPX elements (GPX, track and segment) must have
type GPXPoint ¶
type GPXPoint struct { Point // TODO Timestamp time.Time // TODO: Type MagneticVariation string // TODO: Type GeoidHeight string // Description info Name string Comment string Description string Source string // TODO // Links []GpxLink Symbol string Type string // Accuracy info TypeOfGpsFix string Satellites NullableInt HorizontalDilution NullableFloat64 VerticalDilution NullableFloat64 PositionalDilution NullableFloat64 AgeOfDGpsData NullableFloat64 DGpsId NullableInt }
GPXPoint represents a point of the gpx file
func (*GPXPoint) MaxDilutionOfPrecision ¶
MaxDilutionOfPrecision returns the dilution precision of a GpxWpt.
func (*GPXPoint) SpeedBetween ¶
SpeedBetween calculates the speed between two GpxWpts.
type GPXRoute ¶
type GPXRoute struct { Name string Comment string Description string Source string // TODO //Links []Link Number NullableInt Type string // TODO Points []GPXPoint }
GPXRoute implements a gpx route
func (*GPXRoute) ExecuteOnPoints ¶
ExecuteOnPoints executes given function on all points of the route
type GPXTrack ¶
type GPXTrack struct { Name string Comment string Description string Source string // TODO //Links []Link Number NullableInt Type string Segments []GPXTrackSegment }
GPXTrack implements a gpx track
func (*GPXTrack) AddElevation ¶
AddElevation adds elevation on all points of the track (pointElevation = pointElevation + elevation)
func (*GPXTrack) AddMissingTime ¶
func (trk *GPXTrack) AddMissingTime()
AddMissingTime adds missing times
func (*GPXTrack) AppendSegment ¶
func (trk *GPXTrack) AppendSegment(s *GPXTrackSegment)
AppendSegment adds a segment to the track
func (*GPXTrack) ElevationBounds ¶
func (trk *GPXTrack) ElevationBounds() ElevationBounds
ElevationBounds returns the elevation bouds of the track
func (*GPXTrack) ExecuteOnPoints ¶
ExecuteOnPoints executes given function on track points
func (*GPXTrack) GetTrackPointsNo ¶
GetTrackPointsNo returns the amount of points on the track
func (*GPXTrack) JoinNext ¶
JoinNext joins a GPX segment with the next segment in the current GPX track.
func (*GPXTrack) MovingData ¶
func (trk *GPXTrack) MovingData() MovingData
MovingData returns the moving data of a GPX track.
func (*GPXTrack) PositionAt ¶
func (trk *GPXTrack) PositionAt(t time.Time) []TrackPosition
PositionAt returns a LocationResultsPair for a given time.
func (*GPXTrack) ReduceTrackPoints ¶
ReduceTrackPoints reduces the number of points on the track
func (*GPXTrack) RemoveHorizontalExtremes ¶
func (trk *GPXTrack) RemoveHorizontalExtremes()
RemoveHorizontalExtremes removes horizontal extremes
func (*GPXTrack) RemoveVerticalExtremes ¶
func (trk *GPXTrack) RemoveVerticalExtremes()
RemoveVerticalExtremes removes vertical extremes
func (*GPXTrack) SimplifyTracks ¶
SimplifyTracks does Ramer-Douglas-Peucker algorithm for simplification of polyline
func (*GPXTrack) SmoothHorizontal ¶
func (trk *GPXTrack) SmoothHorizontal()
SmoothHorizontal smoothes the track horizontally
func (*GPXTrack) SmoothVertical ¶
func (trk *GPXTrack) SmoothVertical()
SmoothVertical smoothes the track vertically
func (*GPXTrack) StoppedPositions ¶
func (trk *GPXTrack) StoppedPositions() []TrackPosition
StoppedPositions returns the positions where there was a stop
func (*GPXTrack) TimeBounds ¶
func (trk *GPXTrack) TimeBounds() TimeBounds
TimeBounds returns the time bounds of a GPX track.
func (*GPXTrack) UphillDownhill ¶
func (trk *GPXTrack) UphillDownhill() UphillDownhill
UphillDownhill return the uphill and downhill values of a GPX track.
type GPXTrackSegment ¶
type GPXTrackSegment struct {
Points []GPXPoint
}
GPXTrackSegment represents a segment of a track
func (*GPXTrackSegment) AddElevation ¶
func (seg *GPXTrackSegment) AddElevation(elevation float64)
AddElevation adds elevation on segment points (pointElevation = pointElevation + elevation)
func (*GPXTrackSegment) AddMissingTime ¶
func (seg *GPXTrackSegment) AddMissingTime()
AddMissingTime adds missing times in the segment
func (*GPXTrackSegment) AppendPoint ¶
func (seg *GPXTrackSegment) AppendPoint(p *GPXPoint)
AppendPoint adds a point to the segment
func (*GPXTrackSegment) Bounds ¶
func (seg *GPXTrackSegment) Bounds() GpxBounds
Bounds returns the bounds of a GPX segment.
func (*GPXTrackSegment) Duration ¶
func (seg *GPXTrackSegment) Duration() float64
Duration returns the duration in seconds in a GPX segment.
func (*GPXTrackSegment) ElevationBounds ¶
func (seg *GPXTrackSegment) ElevationBounds() ElevationBounds
ElevationBounds returns the min and max elevation of the segment
func (*GPXTrackSegment) Elevations ¶
func (seg *GPXTrackSegment) Elevations() []NullableFloat64
Elevations returns a slice with the elevations in a GPX segment.
func (*GPXTrackSegment) ExecuteOnPoints ¶
func (seg *GPXTrackSegment) ExecuteOnPoints(executor func(*GPXPoint))
ExecuteOnPoints executes given function on segment points
func (*GPXTrackSegment) GetTrackPointsNo ¶
func (seg *GPXTrackSegment) GetTrackPointsNo() int
GetTrackPointsNo returns the amount of points of the segment
func (*GPXTrackSegment) HasTimes ¶
func (seg *GPXTrackSegment) HasTimes() bool
HasTimes checks if there are times WARNING: currently not implemented!
func (*GPXTrackSegment) Join ¶
func (seg *GPXTrackSegment) Join(seg2 *GPXTrackSegment)
Join concatenates to GPX segments.
func (*GPXTrackSegment) Length2D ¶
func (seg *GPXTrackSegment) Length2D() float64
Length2D returns the 2D length of a GPX segment.
func (*GPXTrackSegment) Length3D ¶
func (seg *GPXTrackSegment) Length3D() float64
Length3D returns the 3D length of a GPX segment.
func (*GPXTrackSegment) MovingData ¶
func (seg *GPXTrackSegment) MovingData() MovingData
MovingData returns the moving data of a GPX segment.
func (*GPXTrackSegment) PositionAt ¶
func (seg *GPXTrackSegment) PositionAt(t time.Time) int
PositionAt returns the GpxWpt at a given time.
func (*GPXTrackSegment) ReduceTrackPoints ¶
func (seg *GPXTrackSegment) ReduceTrackPoints(minDistance float64)
ReduceTrackPoints reduces the number of track points of the segment
func (*GPXTrackSegment) RemoveHorizontalExtremes ¶
func (seg *GPXTrackSegment) RemoveHorizontalExtremes()
RemoveHorizontalExtremes removes horizontal extremes from the segment
func (*GPXTrackSegment) RemoveVerticalExtremes ¶
func (seg *GPXTrackSegment) RemoveVerticalExtremes()
RemoveVerticalExtremes removes vertical extremes from the segment
func (*GPXTrackSegment) SimplifyTracks ¶
func (seg *GPXTrackSegment) SimplifyTracks(maxDistance float64)
SimplifyTracks does Ramer-Douglas-Peucker algorithm for simplification of polyline
func (*GPXTrackSegment) SmoothHorizontal ¶
func (seg *GPXTrackSegment) SmoothHorizontal()
SmoothHorizontal smoothes the segment horizontally
func (*GPXTrackSegment) SmoothVertical ¶
func (seg *GPXTrackSegment) SmoothVertical()
SmoothVertical smoothes the segment vertically
func (*GPXTrackSegment) Speed ¶
func (seg *GPXTrackSegment) Speed(pointIdx int) float64
Speed returns the speed at point number in a GPX segment.
func (*GPXTrackSegment) Split ¶
func (seg *GPXTrackSegment) Split(pt int) (*GPXTrackSegment, *GPXTrackSegment)
Split splits a GPX segment at point index pt. Point pt remains in first part.
func (*GPXTrackSegment) StoppedPositions ¶
func (seg *GPXTrackSegment) StoppedPositions() []TrackPosition
StoppedPositions returns the positions where there was a stop
func (*GPXTrackSegment) TimeBounds ¶
func (seg *GPXTrackSegment) TimeBounds() TimeBounds
TimeBounds returns the time bounds of a GPX segment.
func (*GPXTrackSegment) UphillDownhill ¶
func (seg *GPXTrackSegment) UphillDownhill() UphillDownhill
UphillDownhill returns uphill and dowhill in a GPX segment.
type GpxBounds ¶
type GpxBounds struct { MinLatitude float64 MaxLatitude float64 MinLongitude float64 MaxLongitude float64 }
GpxBounds contains min/max latitude and longitude
type Location ¶
type Location interface { GetLatitude() float64 GetLongitude() float64 GetElevation() NullableFloat64 }
Location implements an interface for all kinds of lat/long/elevation information
type MovingData ¶
type MovingData struct { MovingTime float64 StoppedTime float64 MovingDistance float64 StoppedDistance float64 MaxSpeed float64 }
MovingData contains moving data
func (MovingData) Equals ¶
func (md MovingData) Equals(md2 MovingData) bool
Equals compares to another MovingData struct
type NullableFloat64 ¶
type NullableFloat64 struct {
// contains filtered or unexported fields
}
NullableFloat64 implements a nullable float64
func NewNullableFloat64 ¶
func NewNullableFloat64(data float64) *NullableFloat64
NewNullableFloat64 creates a new NullableFloat64
func (NullableFloat64) MarshalXML ¶
func (n NullableFloat64) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements xml marshalling
func (NullableFloat64) MarshalXMLAttr ¶
MarshalXMLAttr implements xml attribute marshalling
func (*NullableFloat64) NotNull ¶
func (n *NullableFloat64) NotNull() bool
NotNull checks if value is not null
func (*NullableFloat64) SetNull ¶
func (n *NullableFloat64) SetNull()
SetNull sets the value to null
func (*NullableFloat64) SetValue ¶
func (n *NullableFloat64) SetValue(data float64)
SetValue sets the value
func (*NullableFloat64) UnmarshalXML ¶
func (n *NullableFloat64) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements xml unmarshalling
func (*NullableFloat64) UnmarshalXMLAttr ¶
func (n *NullableFloat64) UnmarshalXMLAttr(attr xml.Attr) error
UnmarshalXMLAttr implements xml attribute unmarshalling
type NullableInt ¶
type NullableInt struct {
// contains filtered or unexported fields
}
NullableInt implements a nullable int
func NewNullableInt ¶
func NewNullableInt(data int) *NullableInt
NewNullableInt creates a new NullableInt
func (NullableInt) MarshalXML ¶
func (n NullableInt) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements xml marshalling
func (NullableInt) MarshalXMLAttr ¶
MarshalXMLAttr implements xml attribute marshalling
func (*NullableInt) NotNull ¶
func (n *NullableInt) NotNull() bool
NotNull checks if value is not null
func (*NullableInt) UnmarshalXML ¶
func (n *NullableInt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements xml unmarshalling
func (*NullableInt) UnmarshalXMLAttr ¶
func (n *NullableInt) UnmarshalXMLAttr(attr xml.Attr) error
UnmarshalXMLAttr implements xml attribute unmarshalling
type NullableString ¶
type NullableString struct {
// contains filtered or unexported fields
}
NullableString implements a nullable string
func NewNullableString ¶
func NewNullableString(data string) *NullableString
NewNullableString creates a new NullableString
func (*NullableString) NotNull ¶
func (n *NullableString) NotNull() bool
NotNull checks if value is not null
func (*NullableString) SetValue ¶
func (n *NullableString) SetValue(data string)
SetValue sets the value
type NullableTime ¶
type NullableTime struct {
// contains filtered or unexported fields
}
NullableTime implements a nullable time
func NewNullableTime ¶
func NewNullableTime(data time.Time) *NullableTime
NewNullableTime creates a new NullableTime
func (*NullableTime) NotNull ¶
func (n *NullableTime) NotNull() bool
NotNull checks if value is not null
func (*NullableTime) SetValue ¶
func (n *NullableTime) SetValue(data time.Time)
SetValue sets the value
type Point ¶
type Point struct { Latitude float64 Longitude float64 Elevation NullableFloat64 }
Point represents generic point data and implements the Location interface
func (*Point) Distance2D ¶
Distance2D returns the 2D distance of two GpxWpts.
func (*Point) Distance3D ¶
Distance3D returns the 3D distance of two GpxWpts.
func (*Point) GetElevation ¶
func (pt *Point) GetElevation() NullableFloat64
GetElevation returns the elevation
func (*Point) GetLongitude ¶
GetLongitude returns the longititude
type SpeedsAndDistances ¶
SpeedsAndDistances contaings speed/distance information
type TimeBounds ¶
TimeBounds contains min/max time
func (TimeBounds) Equals ¶
func (tb TimeBounds) Equals(tb2 TimeBounds) bool
Equals compares to another TimeBounds struct
func (*TimeBounds) String ¶
func (tb *TimeBounds) String() string
String implements Stringer interface
type ToXmlParams ¶
ToXmlParams contains settings for xml transformation
type TrackPosition ¶
TrackPosition implements the position of a point on the track
type UphillDownhill ¶
UphillDownhill contains uphill/downhill information
func (UphillDownhill) Equals ¶
func (ud UphillDownhill) Equals(ud2 UphillDownhill) bool
Equals compares to another UphillDownhill struct