Documentation
¶
Index ¶
Constants ¶
const GarminTrackPointExtensionNS = "http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
Variables ¶
var ( ErrBadRootTag = errors.New("gpx: root element must be <gpx>") ErrGPX11Only = errors.New("gpx: can only parse GPX 1.1 documents") )
var (
ErrNoSuchExtension = errors.New("gpx: no such extension")
)
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
type Bounds struct { MinLatitude float64 MinLongitude float64 MaxLatitude float64 MaxLongitude float64 }
Bounds provides information about the document bounds.
type Decoder ¶
type Decoder struct { Strict bool // contains filtered or unexported fields }
Decoder decodes a GPX document from an input stream.
func NewDecoder ¶
NewDecoder creates a new decoder reading from r. The decoder operates in strict mode.
type Document ¶
Document represents a GPX document.
type GarminTrackPointExtension ¶
type GarminTrackPointExtension struct { AirTemp float64 // Air temperature (Celsius) WaterTemp float64 // Water temperature (Celsius) Depth float64 // Diving depth (meters) HeartRate uint // Heart rate (beats per minute) Cadence uint // Cadence (revs per minute) }
GarminTrackPointExtension is Garmin’s TrackPoint extension defined by https://www8.garmin.com/xmlschemas/TrackPointExtensionv1.xsd
func ParseGarminTrackPointExtension ¶
func ParseGarminTrackPointExtension(tokens []xml.Token) (e GarminTrackPointExtension, err error)
ParseGarminTrackPointExtension tries to parse Garmin’s TrackPoint extension from a point’s extensions tokens.
type Metadata ¶
type Metadata struct { Name string Description string Author Person Copyright Copyright Link Link Time time.Time Keywords string Bounds Bounds Extensions []xml.Token }
Metadata provides additional information about a GPX document.
type Point ¶
type Point struct { Latitude float64 Longitude float64 Elevation float64 Time time.Time Extensions []xml.Token }
Point represents a track point. Extensions contains the raw XML tokens of the point’s extensions if it has any (excluding the <extensions> start and end tag).
func (Point) DistanceTo ¶
DistanceTo returns the distance in meters to point p2.
type Segment ¶
type Segment struct {
Points []Point
}
Segments represents a track segment.