1
Fork 0
Bahn2GPX/route.go

23 lines
368 B
Go
Raw Permalink Normal View History

2021-11-20 15:24:31 +00:00
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
}