fix
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user