timetable-mgr/corpus/stations.go

24 lines
620 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)
func createStationEntries(corpusData *[]database.CorpusEntry) *[]database.StationEntry {
2024-03-26 16:04:42 +00:00
var stationEntries []database.StationEntry
for _, entry := range *corpusData {
2024-03-26 16:04:42 +00:00
if entry.CRS != "" {
stationEntry := database.StationEntry{
CRS: entry.CRS,
TIPLOC: entry.TIPLOC,
NLCDESC: entry.NLCDESC,
STANOX: entry.STANOX,
}
stationEntries = append(stationEntries, stationEntry)
}
}
return &stationEntries
2024-03-26 16:04:42 +00:00
}