23 lines
368 B
Go
23 lines
368 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/twpayne/go-gpx"
|
||
|
)
|
||
|
|
||
|
func createRoute(stations []*station) *gpx.GPX {
|
||
|
g := &gpx.GPX{
|
||
|
Version: "1.0",
|
||
|
Creator: "Bahn2GPX",
|
||
|
}
|
||
|
route := &gpx.RteType{}
|
||
|
for _, s := range stations {
|
||
|
route.RtePt = append(route.RtePt, &gpx.WptType{
|
||
|
Lat: s.lat,
|
||
|
Lon: s.lon,
|
||
|
Name: s.name,
|
||
|
})
|
||
|
}
|
||
|
g.Rte = append(g.Rte, route)
|
||
|
return g
|
||
|
}
|