feat(bikeshare): add Detroit, Pittsburgh, Aspen and Kona & Hilo

Register four live US systems on Lyft's PBSC platform: MoGo (Detroit, 81
stations), POGOH (Pittsburgh, 60), WE-cycle (Aspen, 101) and HIBike (Kona
and Hilo, 23). The proxy already allows *.publicbikesystem.net, so no
server change is needed. HIBike's centre sits between Kailua-Kona and
Hilo so a camera over either town loads the whole system.

The test checks each system is registered, passes the proxy's host and
endpoint checks, and has an activation radius covering its farthest
station as measured against the live feed.
This commit is contained in:
Jeff Blakely committed 2026-10-12 12:38:02 -04:00
1 parent 8b8ccc9a81
commit a4d6181fb9
3 files changed
+85

No files matched your search

@@ -0,0 +1,31 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { CITY_BY_ID } from './registry.js';
import { isAllowedGbfsHost, isAllowedGbfsPath } from '../../data/gbfsSource.js';
import { CITY_RANGE_BASE_KM } from './policy.js';
// Each city's PBSC host, and its farthest station from the registered centre
// as measured against the live feed (km), so a camera over any part of the
// system activates it.
const CITIES = {
'detroit-mogo': { host: 'detroit.publicbikesystem.net', provider: 'MoGo', farthestKm: 22.4 },
'pittsburgh-pogoh': { host: 'pittsburgh.publicbikesystem.net', provider: 'POGOH', farthestKm: 9.1 },
'aspen-we-cycle': { host: 'aspen.publicbikesystem.net', provider: 'WE-cycle', farthestKm: 42.6 },
'hawaii-island-hibike': { host: 'kona.publicbikesystem.net', provider: 'HIBike', farthestKm: 53.8 },
};
test('the added US PBSC systems are registered and readable through the proxy', () => {
for (const [id, expected] of Object.entries(CITIES)) {
const city = CITY_BY_ID.get(id);
assert.ok(city, `${id} is registered`);
assert.equal(city.provider, expected.provider);
assert.deepEqual(city.hosts, [expected.host]);
for (const feed of [city.stationInformationUrl, city.stationStatusUrl]) {
const url = new URL(feed);
assert.ok(isAllowedGbfsHost(url.hostname), `${id} host ${url.hostname}`);
assert.ok(isAllowedGbfsPath(url.pathname), `${id} path ${url.pathname}`);
}
const radius = Math.max(CITY_RANGE_BASE_KM, city.loadRadiusKm);
assert.ok(radius > expected.farthestKm, `${id} radius ${radius} covers its farthest station`);
}
});