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

@@ -136,8 +136,8 @@ func ParseRoutes(r io.Reader, callback func(types.Route)) error {
routeType, _ := strconv.Atoi(record[4])
route := types.Route{
Trips: make([]*types.Trip, 0),
RouteID: record[0],
AgencyID: record[1],
RouteId: record[0],
AgencyId: record[1],
RouteShortName: record[2],
RouteLongName: record[3],
RouteType: routeType,

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
})