2024-03-26 16:04:42 +00:00
|
|
|
package corpus
|
|
|
|
|
|
|
|
import "git.fjla.uk/owlboard/go-types/pkg/database"
|
|
|
|
|
2024-03-29 14:01:57 +00:00
|
|
|
// Removes non-station entities from the CORPUS Data, ready for insertion to the database (stations collection)
|
2024-04-10 20:56:13 +01:00
|
|
|
func createStationEntries(corpusData *[]database.CorpusEntry) *[]database.StationEntry {
|
2024-03-26 16:04:42 +00:00
|
|
|
var stationEntries []database.StationEntry
|
|
|
|
|
2024-04-10 20:56:13 +01:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-10 20:56:13 +01:00
|
|
|
return &stationEntries
|
2024-03-26 16:04:42 +00:00
|
|
|
}
|