You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
|
|
}
|