Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/neighborhood999/gpx

Strava GPX parser written in Go.
https://github.com/neighborhood999/gpx

go gpx running strava

Last synced: 19 days ago
JSON representation

Strava GPX parser written in Go.

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/)