This commit is contained in:
2025-11-15 18:05:31 +01:00
parent 5dc296805a
commit 716bd0816c
5 changed files with 189 additions and 174 deletions

View File

@@ -39,8 +39,8 @@ func LoadTripData(path string) (*TripData, error) {
})
case "routes":
err = ParseRoutes(f, func(r types.Route) {
tp.Routes[r.RouteID] = &r
if ag, ok := tp.Agencies[r.AgencyID]; ok {
tp.Routes[r.RouteId] = &r
if ag, ok := tp.Agencies[r.AgencyId]; ok {
r.SetAgency(ag)
// ag.AddRoute(&r)
}
@@ -58,10 +58,10 @@ func LoadTripData(path string) (*TripData, error) {
} else {
log.Printf("route %s not found", trip.RouteId)
}
if agency, ok := tp.Agencies[trip.AgencyID]; ok {
if agency, ok := tp.Agencies[trip.AgencyId]; ok {
trip.Agency = agency
} else {
log.Printf("agency %s not found", trip.AgencyID)
log.Printf("agency %s not found", trip.AgencyId)
}
tp.Trips[trip.TripId] = &trip
})