gpx

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2018 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GPX

type GPX struct {
	XMLName  xml.Name `xml:"gpx"`
	Metadata struct {
		Link struct {
			Href string `xml:"href,attr"`
			Text string `xml:"text"`
		} `xml:"link"`
		Time   time.Time `xml:"time"`
		Bounds struct {
			MaxLat float64 `xml:"maxlat,attr"`
			MaxLon float64 `xml:"maxlon,attr"`
			MinLat float64 `xml:"minlat,attr"`
			MinLon float64 `xml:"minlon,attr"`
		} `xml:"bounds"`
	} `xml:"metadata"`
	Waypoints []Waypoint `xml:"wpt"`
}

GPX represents the contents of an GPX file

func ParseGPXData

func ParseGPXData(in io.Reader) (*GPX, error)

ParseGPXData reads the contents of the GPX file and returns a parsed version

type Waypoint

type Waypoint struct {
	XMLName     xml.Name  `xml:"wpt"`
	Latitude    float64   `xml:"lat,attr"`
	Longitude   float64   `xml:"lon,attr"`
	Elevation   float64   `xml:"ele"`
	Time        time.Time `xml:"time"`
	Name        string    `xml:"name"`
	Comment     string    `xml:"cmt"`
	Description string    `xml:"desc"`
	Symbol      string    `xml:"sym"`
	Type        string    `xml:"type"`
}

Waypoint represents a single waypoint inside a GPX file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL