https://github.com/neighborhood999/gpx
Strava GPX parser written in Go.
https://github.com/neighborhood999/gpx
go gpx running strava
Last synced: 11 months ago
JSON representation
Strava GPX parser written in Go.
- Host: GitHub
- URL: https://github.com/neighborhood999/gpx
- Owner: neighborhood999
- License: mit
- Created: 2020-01-09T04:02:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-16T00:16:17.000Z (about 6 years ago)
- Last Synced: 2025-06-17T07:45:37.361Z (12 months ago)
- Topics: go, gpx, running, strava
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# gpx
A simple gpx parser (support Strava currently) for running and written in Go.
## Installation
```sh
$ make install
```
## Tests
```sh
$ make test
```
## Usage
```go
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"github.com/neighborhood999/gpx"
)
func main() {
f, err := os.Open("running.gpx")
if err != nil {
fmt.Println(err)
}
defer f.Close()
b, _ := ioutil.ReadAll(f)
g, _ := gpx.ReadGPX(bytes.NewReader(b))
fmt.Println(g.Distance()) // Get the total running distance
fmt.Println(g.Duration()) // Get the total running duration
fmt.Println(g.PaceInKM()) // Get the running pace(km/min)
}
```
## LICENSE
MIT © [Peng Jie](https://github.com/neighborhood999/)