timetable-mgr/corpus/stations.go

24 lines
616 B
Go
Raw Normal View History

2024-03-26 16:04:42 +00:00
package corpus
import "git.fjla.uk/owlboard/go-types/pkg/database"
// Removes non-station entities from the CORPUS Data, ready for insertion to the database (stations collection)
2024-03-26 16:04:42 +00:00
func createStationEntries(corpusData []database.CorpusEntry) []database.StationEntry {
var stationEntries []database.StationEntry
for _, entry := range corpusData {
if entry.CRS != "" {
stationEntry := database.StationEntry{
CRS: entry.CRS,
TIPLOC: entry.TIPLOC,
NLCDESC: entry.NLCDESC,
STANOX: entry.STANOX,
}
stationEntries = append(stationEntries, stationEntry)
}
}
return stationEntries
}