Skip to content

Commit

Permalink
Fix invalid gtfs file caused by agencies not in hardcoded list (#95)
Browse files Browse the repository at this point in the history
The timetable can contain routes not in the hardcoded list in
agencies.ts. In particular I've seen QH, QR, QU, and QV in the national
rail data portal timetable.

This commit exports such routes using the existing 'ZZ' - Other operator
agency.
  • Loading branch information
dzfranklin authored Aug 5, 2024
1 parent a78992b commit 7840ec8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gtfs/repository/ScheduleBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import moment = require("moment");
import {ScheduleCalendar} from "../native/ScheduleCalendar";
import {ScheduleStopTimeRow} from "./CIFRepository";
import {StopTime} from "../file/StopTime";
import { agencies } from "../../../config/gtfs/agency";

const pickupActivities = ["T ", "TB", "U "];
const dropOffActivities = ["T ", "TF", "D "];
Expand Down Expand Up @@ -88,7 +89,7 @@ export class ScheduleBuilder {
}
),
mode,
row.atoc_code,
agencies.some((a) => a.agency_id === row.atoc_code) ? row.atoc_code : "ZZ",
row.stp_indicator,
mode === RouteType.Rail && row.train_class !== "S",
row.reservations !== null
Expand Down

0 comments on commit 7840ec8

Please sign in to comment.