Tighten the TransLink and Adelaide Metro docs, comments and release note

This commit is contained in:
German Khokhlov committed 2026-11-18 02:11:42 +04:00
1 parent d7b38c8c62
commit 02f0063cca
6 files changed
+22 -30

No files matched your search

+7 -9
View File
@@ -455,11 +455,10 @@ function burlingtonRouteLabel(routeId) {
}
/**
* TransLink (Queensland) route ids are `<route>-<version>`. Rail lines are two
* two-letter station codes (`BRBN`, `SHCL`), ferries are `F<n>` plus the
* Southern Moreton Bay Islands service `SMBI`, and the Gold Coast light rail
* is `L1`. `SHUT` is the rail-replacement bus. Everything else is a bus, left
* to the feed default so movement plausibility treats it as a guess.
* TransLink route ids are `<route>-<version>`. Rail lines pair two station
* codes (`BRBN`), ferries are `F<n>` and `SMBI`, light rail is `L1`. Buses,
* the `SHUT` rail-replacement bus included, stay on the feed default, which
* movement plausibility treats as a guess.
* @param {string|null} routeId
* @returns {string}
*/
@@ -473,10 +472,9 @@ function translinkRouteMode(routeId) {
}
/**
* TransLink route key to the route a rider would say: drop the `-<version>`
* suffix (`200-4` → `200`, `L1-32` → `L1`), and drop the `C` Cairns puts in
* front of its numbered buses (`C123-33` → `123`). South East Queensland has no
* `C<digits>` routes; its rail codes such as `CLSH` are letters only.
* The route a rider would say: `200-4` → `200`, `L1-32` → `L1`, and Cairns
* `C123-33` → `123`. Only Cairns has `C<digits>` routes; rail codes such as
* `CLSH` are letters only.
* @param {string|null} routeId
* @returns {string|null}
*/
+1 -2
View File
@@ -397,8 +397,7 @@ test('a feed with rider-facing route ids is left alone', () => {
});
test('TransLink route keys lose their GTFS version; Cairns loses its C prefix', () => {
// Both TransLink feeds key routes `<route>-<version>`, and Cairns prefixes
// its numbered buses with C. Ids seen in the live feeds, 9 Nov 2026.
// Ids seen in the live feeds, 9 Nov 2026.
const seq = getTransitFeed('translink-seq');
assert.equal(transitRouteLabel(seq, '200-4'), '200');
assert.equal(transitRouteLabel(seq, 'L1-32'), 'L1', 'Gold Coast light rail');
+2 -4
View File
@@ -48,8 +48,7 @@ test('TransLink route ids resolve rail, light rail and ferries; buses stay a def
assert.equal(transitModeFor(seq, routeId), mode, routeId);
assert.equal(transitModeResolved(seq, routeId), true, routeId);
}
// Buses, Brisbane Metro and the rail-replacement shuttle are buses by the
// feed default, so movement plausibility does not treat them as known.
// Buses stay on the feed default, so movement plausibility treats them as a guess.
for (const routeId of ['600', '250-5169', 'M1-4949', 'SHUT-5213', null]) {
assert.equal(transitModeFor(seq, routeId), 'bus', String(routeId));
assert.equal(transitModeResolved(seq, routeId), false, String(routeId));
@@ -60,7 +59,6 @@ test('TransLink route ids resolve rail, light rail and ferries; buses stay a def
});
test('Adelaide Metro route ids resolve trains, trams and the SeaLink ferry', () => {
// The feed entry is main's; this PR adds only its routeMode.
const adelaide = getTransitFeed('adelaide-metro');
const cases = [
['BEL', 'rail'],
@@ -121,6 +119,6 @@ test('DATA_SOURCES documents the TransLink feeds in the transit row style', () =
assert.equal(
adelaide.length,
1,
'exactly one Adelaide Metro transit row (main’s)',
'one Adelaide Metro Transit row',
);
});