mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 17:22:19 +00:00
Merge pull request #1169 from willrenzo39/feat/australia-transit
feat(transit): add TransLink Cairns and route labels; Adelaide train and tram modes
This commit is contained in:
8 files changed
+234
-10
No files matched your search
+2
-2
@@ -99,7 +99,7 @@ How to read this:
|
||||
| **Metro Transit** (Metropolitan Council) | Transit layer live vehicles, Minneapolis–St Paul | Metro Transit / Metropolitan Council open realtime vehicle data, used for the live view; published for developer use and not against their use. | Attribution to Metro Transit / Metropolitan Council (courtesy text) |
|
||||
| **OVapi / Stichting OpenGeo** | Transit layer live vehicles, Netherlands | OVapi / Stichting OpenGeo open realtime vehicle data, used for the live view; published for developer use and not against their use. The client sends a User-Agent and conditional requests. | Attribution to OVapi / Stichting OpenGeo (courtesy text) |
|
||||
| **Entur** (api.entur.io) | Transit layer live vehicles, Norway | Entur open realtime vehicle data, used for the live view; published for developer use and not against their use. The client sends the `ET-Client-Name` identifying header. | Attribution to Entur (courtesy text) |
|
||||
| **TransLink** (Queensland Government) | Transit layer live vehicles, South East Queensland | TransLink / Queensland Government open realtime vehicle data, used for the live view; published for developer use and not against their use. | Attribution to TransLink / Queensland Government (courtesy text) |
|
||||
| **TransLink** (Queensland Government) | Transit layer live vehicles, South East Queensland and Cairns | TransLink / Queensland Government open realtime vehicle data, used for the live view; published for developer use and not against their use. | Attribution to Translink, Department of Transport and Main Roads (courtesy text) |
|
||||
| **HSL** (realtime.hsl.fi) | Transit layer live vehicles, Helsinki | HSL (Helsinki Region Transport) open realtime vehicle data, used for the live view; published for developer use and not against their use. | Attribution to HSL (Helsinki Region Transport) (courtesy text) |
|
||||
| **TTC** (bustime.ttc.ca) | Transit layer live vehicles, Toronto — surface vehicles (buses and streetcars) only | Toronto Transit Commission BusTime open realtime vehicle data, published through City of Toronto Open Data and used for the live view. The subway publishes no vehicle positions, so Lines 1/2/4 are absent rather than inferred. | Attribution to Toronto Transit Commission — City of Toronto Open Data, under the Open Government Licence – Toronto |
|
||||
| **MiWay** (miapp.ca) | Transit layer live vehicles, Mississauga ON | MiWay open realtime vehicle data, published by the City of Mississauga under its Open Data Terms of Use, used for the live view. The licence is revocable and asks that the Terms of Use link travel with the data. | Attribution to MiWay — City of Mississauga Open Data, linked to the Terms of Use |
|
||||
@@ -272,7 +272,7 @@ The optional Local ADS-B layer and the broadcast-FM receiver use radio you recei
|
||||
- **Houston TranStar cameras.** Keyless. The camera list is the public `traffic.houstontranstar.org/data/layers/cctvSnapshots_json.js` catalog (~1,000 cameras across Greater Houston); frames are stills at `www.houstontranstar.org/snapshots/cctv/<id>.jpg`, synthesized from a validated numeric id rather than taken from the payload, and only that host is registered. Cameras whose catalog id is `0` (a different, non-snapshot class) and cameras outside Greater Houston are dropped. TranStar's `dir` field is the side of the freeway the camera sits on, not the way it faces: TranStar's own map shows it as "Traffic closest to the camera is traveling …" (South → eastbound, North → westbound, West → southbound, East → northbound). That travel direction (90°, 270°, 180°, 0°) seeds the heading as a low-confidence prior with the low-confidence pose; `None` or an unknown value uses the shared id-hash fallback at low confidence. Headings are corrected with the in-app calibration gizmo. Off by default. TranStar's [Content Usage terms](https://traffic.houstontranstar.org/disclaimer.aspx) prohibit copying or distributing the site's information, and external framing or linking to specific images, without TxDOT's prior written permission; its FAQ grants permission-free use only for the RSS feeds. This project does not hold that permission for downstream installations, so the pack loads only when an operator who holds TxDOT's written permission sets `CCTV_HOUSTON_ENABLED=1`; with the flag unset, empty or any other value, the server makes no request to TranStar. Once enabled, it loads the 250 cameras nearest downtown, Uptown, the Medical Center, IAH and Galveston; `CCTV_HOUSTON_MAX_SOURCES` (8–400) changes the cap. Snapshots update about every 3 minutes, which is also the ambient still cadence. Frames are fetched from TranStar and relayed to the browser on demand, buffered only transiently per request, sent with `Cache-Control: no-store`, and not archived.
|
||||
- **Autostrada del Brennero (A22) webcams.** Keyless. The camera list is one request to the Open Data Hub tourism API (`tourism.api.opendatahub.com/v1/WebcamInfo?source=a22`), run by NOI Techpark in South Tyrol, which republishes Autobrennero's own list of 13 motorway webcams with coordinates and kilometre markers. Frames are the operator's stills on `www.autobrennero.it/WebCamImg/km<N>.jpg`, refreshed about once a minute, and only the exact image for each camera's kilometre is registered. The feed names no bearing, so headings use the id-hash fallback at low confidence. The road climbs from about 20 m in the Po valley to about 1,370 m at the Brenner Pass, so each camera's ground elevation comes from a per-kilometre table sampled from the Copernicus GLO-90 DEM (via Open-Meteo's elevation API); a camera not in the table uses a 200 m prior. The Open Data Hub tags every record CC0 (`ClosedData: false`, Autobrennero as licence holder), but that tag is the aggregator's metadata and Autobrennero publishes no terms of its own for the images, so they are credited to the operator as a courtesy and are not redistributed. Frames are fetched at request time and never stored. Disable with `CCTV_A22_ENABLED=0`.
|
||||
- **Camera frame content.** Public camera frames can contain people, vehicles and license plates, and the camera layer does nothing with them beyond putting them on the map. A successful upstream response is relayed as the provider served it: nothing in the camera pipeline blurs, redacts, enhances or restores it, and nothing there runs face, plate or object detection or otherwise recognises or classifies what is in the picture. (The ALPR layer described below maps where plate-reader cameras are, from locations contributors tagged in OpenStreetMap; it reads nothing from any camera frame.) When an upstream has no frame for a camera, what you see instead is a Google Street View still or the app's own placeholder card; the panel's source badge names which of them you are looking at, and a refresh that fails after a frame has arrived leaves the last good picture on screen rather than replacing it. The browser resamples each frame for display: onto a fixed 1920x1080 surface for the camera's projection plane in the scene, and onto a 192x108 canvas for the small ambient card. That scaling is the only change made to the picture, and the only pixels the camera layer reads back are a 64x36 downscale hashed to tell whether the picture has changed. Live streams are piped through; the still path reads the image into memory to pass it on — TxDOT wraps its JPEG in a JSON envelope, which is decoded there — and no frame is written to disk (the disk cache, `.gev-cache/`, holds feed JSON for other layers and never camera imagery). Outside that pipeline, the voice assistant is the one feature that sends imagery anywhere: when it answers a question about what is in view it may attach a downscaled screenshot of the rendered scene — including any camera plane on screen — to the request it sends to the voice model. Frames are fetched only from server-registered camera URLs — a client cannot hand the proxy a URL (see [SECURITY.md](SECURITY.md)). What the app does stays inside the line README draws: no named-person search, no face recognition, no tracking individuals.
|
||||
- **Transit (GTFS-Realtime).** The proxy requests only registered operator feeds, validates redirects, bounds responses, and uses conditional requests, short snapshot caching and failure backoff. All fifty-two registered feeds, covering forty-nine regions, are live-enabled; each can be disabled independently. Vehicles use delayed playback between reports, with report age and waiting states shown separately. Session-local selected trails are available for every feed. MBTA additionally retains up to 15 minutes of recently observed positions in the running proxy, so available history can survive a browser reload; server restart clears it. History reads never fetch upstream, and other feeds have no proxy retention. Nothing is archived to disk or collected in the background. Operator text credits are included as a courtesy and do not imply endorsement. Heights are aligned to work with Google 3D tiles; subway markers are shown at street level because these feeds do not supply depth. The TTC feed is BusTime, the surface system: it carries buses and streetcars and no subway at all. About four in ten of its vehicles report no route at all (unassigned or deadheading), and those are shown with the feed default rather than a route-established mode. It sends no ETag or Last-Modified, so its conditional requests fall through to the ordinary snapshot cache. Three Golden Horseshoe neighbours run alongside it — MiWay, Hamilton HSR and Durham Region Transit — each bus-only and each polled only near its own region. Durham Region Transit publishes no bearing on any vehicle, so those sprites take their heading from observed movement like any other feed that omits it. Guelph, Kingston and Barrie extend the same pattern eastward and north. Hamilton, Guelph, Burlington, YRT and Rio’s SMTR publish route ids that are not the number on the vehicle, so those entries carry a route-name table taken from each operator’s own published GTFS; any id missing from a table renders unchanged rather than blank. A label is never invented: YRT runs a route `9101` that appears nowhere in its published routes, so it stays as the feed sends it. Burlington’s is the one that cannot be shortcut: `351` is route 1 while `3510` is route 10, so the table is a real join rather than a trimmed prefix. GO Transit / Metrolinx is deliberately absent: its REALTIME feed requires an API key issued by manual review, which the keyless admission rule excludes (its static schedule download is keyless, but carries no vehicle positions). Barrie and YRT/Viva each invite acceptance of their licence through a form, and each licence also states that using the data is itself acceptance; this deployment relies on that clause, which is recorded in both entries. Grand River Transit in Waterloo is absent for a different reason: it answers, but its feed header was months stale and it publishes no per-vehicle timestamps, so it would render vehicles that look live and are not. Ottawa’s OC Transpo falls to the same keyless admission rule as GO Transit — its realtime feed requires an API key. London Transit and Thunder Bay Transit publish vehicle positions over plain HTTP with no HTTPS endpoint available. Every other Ontario system — Brampton, Oakville, Niagara, Milton, Windsor, Greater Sudbury, UP Express and a dozen smaller operators — publishes static GTFS schedules only, with no realtime vehicle positions to register. Between the nine included and these exclusions, every Ontario realtime vehicle-position feed catalogued in the Mobility Database is accounted for.
|
||||
- **Transit (GTFS-Realtime).** The proxy requests only registered operator feeds, validates redirects, bounds responses, and uses conditional requests, short snapshot caching and failure backoff. All fifty-three registered feeds, covering fifty regions, are live-enabled; each can be disabled independently. Vehicles use delayed playback between reports, with report age and waiting states shown separately. Session-local selected trails are available for every feed. MBTA additionally retains up to 15 minutes of recently observed positions in the running proxy, so available history can survive a browser reload; server restart clears it. History reads never fetch upstream, and other feeds have no proxy retention. Nothing is archived to disk or collected in the background. Operator text credits are included as a courtesy and do not imply endorsement. Heights are aligned to work with Google 3D tiles; subway markers are shown at street level because these feeds do not supply depth. The TTC feed is BusTime, the surface system: it carries buses and streetcars and no subway at all. About four in ten of its vehicles report no route at all (unassigned or deadheading), and those are shown with the feed default rather than a route-established mode. It sends no ETag or Last-Modified, so its conditional requests fall through to the ordinary snapshot cache. Three Golden Horseshoe neighbours run alongside it — MiWay, Hamilton HSR and Durham Region Transit — each bus-only and each polled only near its own region. Durham Region Transit publishes no bearing on any vehicle, so those sprites take their heading from observed movement like any other feed that omits it. Guelph, Kingston and Barrie extend the same pattern eastward and north. Hamilton, Guelph, Burlington, YRT and Rio’s SMTR publish route ids that are not the number on the vehicle, so those entries carry a route-name table taken from each operator’s own published GTFS; any id missing from a table renders unchanged rather than blank. A label is never invented: YRT runs a route `9101` that appears nowhere in its published routes, so it stays as the feed sends it. Burlington’s is the one that cannot be shortcut: `351` is route 1 while `3510` is route 10, so the table is a real join rather than a trimmed prefix. TransLink needs no table: its route keys carry a GTFS version suffix (`200-4`) and Cairns puts a `C` before its bus numbers (`C123-33`), so both are stripped by rule to the number on the vehicle. GO Transit / Metrolinx is deliberately absent: its REALTIME feed requires an API key issued by manual review, which the keyless admission rule excludes (its static schedule download is keyless, but carries no vehicle positions). Barrie and YRT/Viva each invite acceptance of their licence through a form, and each licence also states that using the data is itself acceptance; this deployment relies on that clause, which is recorded in both entries. Grand River Transit in Waterloo is absent for a different reason: it answers, but its feed header was months stale and it publishes no per-vehicle timestamps, so it would render vehicles that look live and are not. Ottawa’s OC Transpo falls to the same keyless admission rule as GO Transit — its realtime feed requires an API key. London Transit and Thunder Bay Transit publish vehicle positions over plain HTTP with no HTTPS endpoint available. Every other Ontario system — Brampton, Oakville, Niagara, Milton, Windsor, Greater Sudbury, UP Express and a dozen smaller operators — publishes static GTFS schedules only, with no realtime vehicle positions to register. Between the nine included and these exclusions, every Ontario realtime vehicle-position feed catalogued in the Mobility Database is accounted for.
|
||||
- **Rail (GTFS-Realtime trains).** Each feed in `src/data/railFeeds.js` records its licence, its credit and the passage of its terms the decision rests on, and a feed is switched on only when those terms were read and cover this use, or, for those that publish no licence at all, on the basis its entry records. Such a basis is never a licence, and the credit does not present it as one: its label says there is no licence ("No licence published", "No licence stated") or names the publication the use rests on. Five enabled feeds publish no licence for their train positions. MARC is used on what its publication says (open publication with a no-endorsement disclaimer), and METRO light rail on the same basis as the Transit layer's Metro Transit feed. Tri-Rail and Charlotte's LYNX are used without a published licence by project owner decision of 2026-11-10. The fifth is Irish Rail, whose train positions publish no licence while its NTA timetable is CC BY 4.0. The registry lists 30 feeds, all switched on, and every one is keyless: its realtime feed and its static timetable are published for anyone to fetch, so no feed needs a key, an account or a registration, and the server holds no rail credential. No rail request carries a credential of the deployer's; one feed's published URL includes a fixed public value its publisher prints for everyone (Bordeaux's `apiKey`). `/api/rail/feeds` lists the offered feeds, `/api/rail/trains/<feedId>` returns one feed's train snapshot, `/api/rail/updates/<feedId>` its trip updates, and `/api/rail/paths/<feedId>` and `/api/rail/schedule/<feedId>` its path and schedule packs, when built. The proxy requests only registered feeds and reuses the Transit proxy's request policy (a short snapshot cache with single-flight refresh, serve-stale, admission limits, the failure cooldown ladder, redirects followed hop by hop only on the feed's own https origin, and an 8 MiB body cap unless a feed sets its own, at most 64 MiB). Many operators publish trains in the same feed as their buses, so each feed has a classifier: the proxy keeps only vehicles it recognises as trains, tags each with a category (`transit`, `local`, `regional`, `national` or `international`) and a mode (`rail`, `metro` or `tram`), and drops everything else server-side, counted in the snapshot as `dropped`; the browser never receives a bus. Every train shown is live, where its operator last reported it: 29 feeds publish live GPS positions (SJ Nord's through SIRI VM), and Irish Rail reports the station or timing point a train last passed. No train is placed or moved from a timetable; a feed whose live positions fail shows as unavailable, and its trains age out as any quiet train does. 22 feeds register trip updates, polled while one of their trains is selected and that feed's schedule pack is loaded. 28 feeds work out of the box. Packs are an opt-in extra for live trains: nothing is downloaded when the app starts, and `node scripts/build-rail-paths.mjs --feed <id>` (repeatable) or `--all` downloads a feed's static GTFS (29 of the 30 have one) and writes a path pack (the operator's track shapes) and a schedule pack (the stop times for a window of days) to `.cache/rail-paths/` (or to `RAIL_PATHS_DIR` when set, the directory the server then serves). With them, a live train is drawn on its operator's route line and its card names its stops, its next stop and, from the trip updates, their delays. Renfe long and medium distance and KTMB, whose vehicles name no route, are classified from their pack's routes, so `/api/rail/feeds` lists them only once that pack is built. Lines are the operator's own shapes as published: nothing is routed or redrawn from other map data, and no line is drawn where an operator publishes no shape. **Share-alike sources bind the deployer.** A pack built from a ShareAlike or ODbL source is a derived database of it, so a deployer who serves it publicly makes it subject to the same licence and must offer it under that licence with the attribution kept. That covers the Montpellier packs (ODbL). For the ODbL datasets of France's national access point, its special conditions also require that "Les bases de données ainsi repartagées doivent être publiées sur le Point d'accès national transport.data.gouv.fr, dans le format d'origine" ([Licence ODbL](https://doc.transport.data.gouv.fr/le-point-d-acces-national/cadre-juridique/conditions-dutilisation-des-donnees/licence-odbl), read 2026-11-10): a deployer who serves the Montpellier packs publicly takes on republishing that derived data there, as GTFS. The build downloads each static GTFS itself, over https and with no credential. A feed's `staticRouteTypes` lists the route types it keeps when its classifier accepts every route of a mode-specific feed. A frequency-based trip becomes one run per departure on its template's stops and run times. Packs are build output, not part of the repository, and cover a fixed window of days, so they are rebuilt before it ends, anLine truncated
|
||||
- **Radio country coverage (optional).** Set `RADIO_PRIORITY_COUNTRIES=IN,PL` in the local `.env` and restart to include stations beyond the global click charts. The operator may choose up to eight unique ISO alpha-2 country codes; no key is needed. Each country adds one bounded query (at most 200 rows) and reserves up to 40 unique, usable stations inside the existing 750-station catalog. Country seeds precede specialist-tag seeds and global popularity fill; unused slots return to the shared pool. This is a coverage preference, not an exhaustive national directory or a guarantee of stations in every city. Countries with no eligible HTTPS MP3/AAC geolocated stations remain empty. An unset list preserves global selection. Country requests share the directory cache and three-worker pool; failed country queries are reported in coverage without blocking a healthy global refresh. Failed/degraded refreshes back off for one minute, with at most three mirrors per query.
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ Twenty-three layers and map sources. **Twenty-one have a keyless path.** Some of
|
||||
| 📷 **Mapped ALPR Cameras** | License-plate-reader camera locations tagged by OpenStreetMap contributors, loaded one city-sized view at a time, with **SHOW NEAREST**. Locations and tags only: no plate data, no video | OpenStreetMap (incl. DeFlock mapping) | 🟢 |
|
||||
| 📷 **Street Level** | Street-level photos behind one panel, one chip per provider: coverage on the streets, image cones, an embedded viewer with full-screen **EXPAND**. Mapillary, Google Street View, KartaView and Panoramax | Mapillary · Google · KartaView · Panoramax | 🟢 KartaView, Panoramax · 🟡 Mapillary token · 🔴 Google Maps key |
|
||||
| 📻 **Radio** | Geolocated world radio with an **analog tuner** — drag the needle across up to 750 stations and the globe flies to each broadcaster | Radio Browser / broadcasters | 🟢 |
|
||||
| 🚌 **Transit** | Live buses, trams, metros, trains and ferries with delayed playback between reports, selected-vehicle trails, and mode-coloured DETECT labels — Boston, Austin, Minneapolis, Helsinki, the Netherlands, Norway, South East Queensland, Rio de Janeiro (buses and BRT), Szczecin, Lisbon (Carris Metropolitana and the city’s Carris), Prague, Warsaw, Kraków, Poznań, Gdańsk, Rzeszów, Vilnius, Bucharest, Cluj-Napoca, Iași, Rome, Turin, Venice (buses and waterbuses), Bordeaux, Montpellier, Rouen, Toulon, Le Havre, Tours, Málaga, Sendai, Johor Bahru, Kota Bharu, Adelaide, Atlanta, Denver, Edmonton, Halifax, Victoria, and nine in Ontario: Toronto (surface vehicles; the subway publishes no positions), Mississauga, Hamilton, Durham Region, York Region, Guelph, Burlington, Barrie and Kingston | Operator GTFS-Realtime feeds | 🟢 |
|
||||
| 🚌 **Transit** | Live buses, trams, metros, trains and ferries with delayed playback between reports, selected-vehicle trails, and mode-coloured DETECT labels — Boston, Austin, Minneapolis, Helsinki, the Netherlands, Norway, South East Queensland, Cairns, Rio de Janeiro (buses and BRT), Szczecin, Lisbon (Carris Metropolitana and the city’s Carris), Prague, Warsaw, Kraków, Poznań, Gdańsk, Rzeszów, Vilnius, Bucharest, Cluj-Napoca, Iași, Rome, Turin, Venice (buses and waterbuses), Bordeaux, Montpellier, Rouen, Toulon, Le Havre, Tours, Málaga, Sendai, Johor Bahru, Kota Bharu, Adelaide, Atlanta, Denver, Edmonton, Halifax, Victoria, and nine in Ontario: Toronto (surface vehicles; the subway publishes no positions), Mississauga, Hamilton, Durham Region, York Region, Guelph, Burlington, Barrie and Kingston | Operator GTFS-Realtime feeds | 🟢 |
|
||||
| 🚆 **Rail** | Live trains across the US, Canada, Australia, Ireland, Finland, Spain, Norway, Malaysia, Japan and France, from 30 keyless operator feeds: live GPS positions from 29 of them and Irish Rail’s station reports, 28 live out of the box, and Renfe long and medium distance and KTMB once their pack is built. No train is placed from a timetable. Opt-in packs (`node scripts/build-rail-paths.mjs --feed <id>` or `--all`) add the operator’s own route lines, stop names, next stops and trip-update delays. Coloured by service category (urban, local, regional, national, international) with a filter chip and legend for each; trains are drawn once when several feeds carry them, and open a card per train. Buses in mixed feeds are dropped by the server | Operator GTFS-Realtime feeds (static GTFS for opt-in packs) | 🟢 |
|
||||
| 🚲 **Bikeshare** | Live station availability | GBFS | 🟢 |
|
||||
| 🧭 **Directions** | Click A and B on the globe for a street-following drive, walk or cycle route draped on the terrain with turn-by-turn steps — then FLY the camera along it. No key, no geocoder, no mic | OSRM on FOSSGIS servers (OpenStreetMap) | 🟢 |
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- Transit adds TransLink Cairns, a keyless feed under CC BY 4.0. TransLink
|
||||
trains, Gold Coast light rail and ferries, and Adelaide Metro trains, trams
|
||||
and the SeaLink ferry, now show as their own modes instead of buses.
|
||||
TransLink route labels drop the GTFS version and Cairns's `C` prefix, so a
|
||||
bus reads "Route 123", not "Route C123-33" (willrenzo39, #1169).
|
||||
@@ -5893,7 +5893,7 @@ its criteria cannot be silently ignored.
|
||||
| Traffic | Selectable TomTom / OpenStreetMap / Hybrid roads; optional TomTom flow (BYOK) | `src/data/traffic.js` | browser-direct OpenFreeMap tiles; `/api/tomtom` for flow | viewport-driven; capped tile cache |
|
||||
| CCTV | Austin + Caltrans (CA) + TfL London + Ontario 511 + Fintraffic (FI) + DriveBC (BC) + TxDOT (TX) + Estonia (Tallinn, Tarktee) + Live Traffic NSW + Open Calgary Open Data + Statens vegvesen (NO, stills + live HLS, Kartverket ground heights) + King County (WA) Open Data + WSDOT (WA) Open Data + NYC DOT TMC (opt-in) + City of Toronto RESCU + Catalonia (Servei Català de Trànsit) + Iceland (Vegagerðin / IRCA) + Hong Kong Transport Department + FL511 (FL, opt-in) + Freeway Bureau, MOTC (Taiwan) + Houston TranStar (opt-in) + Autostrada del Brennero (IT, A22 stills) + Street View fallback | `src/data/cctv.js` | `/api/cctv` | 10s (active) |
|
||||
| Radio | Radio Browser (public-domain station directory) | `src/data/radio.js` | `/api/radio/stations`, `/api/radio/click/:uuid` | 45 min directory refresh |
|
||||
| Transit 🚌 | Operator GTFS-Realtime VehiclePositions (7 keyless regions, `src/data/transitFeeds.js`) | `src/layers/transit/` via `src/app/layers/transit.js` | `/api/transit` | 15s (poll + delayed playback) |
|
||||
| Transit 🚌 | Operator GTFS-Realtime VehiclePositions (53 keyless feeds, 50 regions, `src/data/transitFeeds.js`) | `src/layers/transit/` via `src/app/layers/transit.js` | `/api/transit` | 15s (poll + delayed playback) |
|
||||
| Rail 🚆 | Live operator train positions (GPS, or station reports for Irish Rail) and trip updates, trains only, with opt-in route packs built from static GTFS (30 keyless feeds, all on, 28 out of the box; `src/data/railFeeds.js`) | `src/layers/rail/` via `src/app/layers/rail.js` | `/api/rail` | 15s (poll + delayed playback) |
|
||||
| Bikeshare 🚲 | GBFS (Lyft + BCycle + Social Bicycles + PBSC incl. Bike Share Toronto, Bike Itaú (Brazil), Bicing (Barcelona) and seven other Spanish cities + Urban Sharing, Entur, JCDecaux (Lillestrøm, Valencia, Seville) + nextbike (AMBici)) | `src/data/bikeshare.js` | `/api/gbfs` | 60s |
|
||||
| Directions 🧭 | OSRM on FOSSGIS servers (OpenStreetMap) | `src/data/directions.js` | `/api/route` (`steps=1`) | on placement / mode change |
|
||||
@@ -6468,8 +6468,8 @@ Transit is off by default, and share links use token `j`. The movement panel ord
|
||||
places Transit directly after Street Traffic and before Rail. Cameras and
|
||||
utilities retain their own groups. The layer polls
|
||||
registered feeds near the camera every 15 seconds, below a 3,000 km altitude
|
||||
gate. Forty-nine keyless regions are available: Boston, Austin, Minneapolis–St Paul,
|
||||
Helsinki, the Netherlands, Norway, South East Queensland, Rio de Janeiro
|
||||
gate. Fifty keyless regions are available: Boston, Austin, Minneapolis–St Paul,
|
||||
Helsinki, the Netherlands, Norway, South East Queensland, Cairns, Rio de Janeiro
|
||||
(municipal buses and the Mobi-Rio BRT, two feeds), Szczecin, the Lisbon Metropolitan Area and the city of Lisbon, Prague and Central Bohemia, Warsaw, Kraków (buses and trams, two feeds), Poznań, Gdańsk, Rzeszów, Vilnius, Bucharest, Cluj-Napoca, Iași, Rome, Turin, Venice (buses and waterbuses, two feeds), Bordeaux, Montpellier, Rouen, Toulon, Le Havre, Tours, Málaga, Sendai, Johor Bahru, Kota Bharu, Adelaide, Atlanta, Denver, Edmonton, Halifax, Victoria, and nine in
|
||||
Ontario — Toronto (TTC surface vehicles; the subway publishes no
|
||||
positions), MiWay, Hamilton HSR, Durham Region, YRT/Viva, Guelph,
|
||||
@@ -6490,10 +6490,13 @@ a record from the bundled proxy is classified by the hints alone. Route hints
|
||||
read from each operator's routes.txt cover Prague's trolleybus lines and Petřín
|
||||
funicular, and Bucharest, Cluj-Napoca and Turin's trams, trolleybuses and metro
|
||||
lines (and Turin's Sassi–Superga rack tramway, typed a funicular in its
|
||||
routes.txt). Le Havre's funicular is a correction, not read from routes.txt: its
|
||||
routes.txt). Route-id hints also cover TransLink's rail, Gold Coast light rail
|
||||
and ferries, and Adelaide Metro's trains, trams and SeaLink ferry; their other
|
||||
routes stay buses by default. Le Havre's funicular is a correction, not read from routes.txt: its
|
||||
route hint and its correction both say funicular. Vilnius publishes no route ids in its positions, so
|
||||
its trolleybuses read as buses. Retained history classifies its epochs the same
|
||||
way, so a trail joins the live vehicle.
|
||||
its trolleybuses read as buses. TransLink labels drop the GTFS version and
|
||||
Cairns's `C` prefix (`C123-33` reads as route 123). Retained history classifies
|
||||
its epochs the same way, so a trail joins the live vehicle.
|
||||
|
||||
Retained transit history uses the same outlier quarantine as live observations and
|
||||
preserves the active live bracket. Rejected reports do not publish route or mode
|
||||
|
||||
@@ -862,6 +862,7 @@
|
||||
"src/data/rioRouteNames.js",
|
||||
"src/data/transitFeeds.js",
|
||||
"src/data/transitFeeds.test.mjs",
|
||||
"src/data/transitFeedsAustralia.test.mjs",
|
||||
"src/data/transitProxy.js",
|
||||
"src/data/transitProxy.test.mjs",
|
||||
"src/data/gtfsRealtime.js",
|
||||
|
||||
@@ -454,6 +454,66 @@ function burlingtonRouteLabel(routeId) {
|
||||
return BURLINGTON_ROUTE_NAMES[routeId] || routeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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}
|
||||
*/
|
||||
function translinkRouteMode(routeId) {
|
||||
if (!routeId) return 'unknown';
|
||||
const route = routeId.replace(/-\d+$/, '');
|
||||
if (/^F\d+$/.test(route) || route === 'SMBI') return 'ferry';
|
||||
if (route === 'L1') return 'tram';
|
||||
if (/^[A-Z]{4}$/.test(route) && route !== 'SHUT') return 'rail';
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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}
|
||||
*/
|
||||
function translinkRouteLabel(routeId) {
|
||||
const route = routeId.replace(/-\d+$/, '');
|
||||
const cairns = /^C(\d+)$/.exec(route);
|
||||
return cairns ? cairns[1] : route;
|
||||
}
|
||||
|
||||
/** Adelaide Metro train and tram route ids, from its static routes.txt. */
|
||||
const ADELAIDE_RAIL_ROUTES = new Set([
|
||||
'BEL',
|
||||
'FLNDRS',
|
||||
'GAW',
|
||||
'GAWC',
|
||||
'GRNG',
|
||||
'NOAR',
|
||||
'OSBORN',
|
||||
'OUTHA',
|
||||
'PTDOCK',
|
||||
'SALIS',
|
||||
'SEAFRD',
|
||||
]);
|
||||
const ADELAIDE_TRAM_ROUTES = new Set(['BTANIC', 'FESTVL', 'GLNELG']);
|
||||
|
||||
/**
|
||||
* Adelaide Metro route ids are the line codes; all-letter bus routes exist
|
||||
* (`INDSTA`), so trains and trams are listed rather than pattern-matched.
|
||||
* @param {string|null} routeId
|
||||
* @returns {string}
|
||||
*/
|
||||
function adelaideMetroRouteMode(routeId) {
|
||||
if (!routeId) return 'unknown';
|
||||
if (ADELAIDE_RAIL_ROUTES.has(routeId)) return 'rail';
|
||||
if (ADELAIDE_TRAM_ROUTES.has(routeId)) return 'tram';
|
||||
if (routeId === 'SEALNK') return 'ferry';
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
/**
|
||||
* Rio route key to the line a rider would say. One SMTR `routes.txt` covers
|
||||
* both feeds (see rioRouteNames.js).
|
||||
@@ -898,7 +958,7 @@ export const TRANSIT_FEED_REGISTRY = Object.freeze([
|
||||
url: 'https://gtfsrt.api.translink.com.au/api/realtime/seq/VehiclePositions',
|
||||
license: 'CC BY 4.0',
|
||||
licenseUrl: 'https://translink.com.au/about-translink/open-data',
|
||||
attribution: 'TransLink — Queensland Government (CC BY 4.0)',
|
||||
attribution: 'Translink, Department of Transport and Main Roads',
|
||||
defaultEnabled: true,
|
||||
terms: Object.freeze({
|
||||
quote:
|
||||
@@ -906,6 +966,28 @@ export const TRANSIT_FEED_REGISTRY = Object.freeze([
|
||||
note: 'No key, no stated rate limit, no caching rule. Logos and network imagery need separate approval, so the credit is text only.',
|
||||
}),
|
||||
defaultMode: 'bus',
|
||||
routeMode: translinkRouteMode,
|
||||
routeLabel: translinkRouteLabel,
|
||||
}),
|
||||
transitFeed({
|
||||
id: 'translink-cairns',
|
||||
name: 'TransLink',
|
||||
operator: 'TransLink (Queensland Government)',
|
||||
region: 'Cairns, Australia',
|
||||
center: { lat: -16.9186, lon: 145.7781 },
|
||||
loadRadiusKm: 60,
|
||||
url: 'https://gtfsrt.api.translink.com.au/api/realtime/CNS/VehiclePositions',
|
||||
license: 'CC BY 4.0',
|
||||
licenseUrl: 'https://translink.com.au/about-translink/open-data',
|
||||
attribution: 'Translink, Department of Transport and Main Roads',
|
||||
terms: {
|
||||
quote:
|
||||
'Our data is licensed under a Creative Commons Attribution 4.0 International License. Authentication is not required to use the feed.',
|
||||
note: 'The same open-data page lists Cairns (CNS) vehicle positions beside South East Queensland; same terms, text-only credit.',
|
||||
},
|
||||
defaultMode: 'bus',
|
||||
routeMode: translinkRouteMode,
|
||||
routeLabel: translinkRouteLabel,
|
||||
}),
|
||||
Object.freeze({
|
||||
id: 'ttc-toronto',
|
||||
@@ -1535,6 +1617,7 @@ export const TRANSIT_FEED_REGISTRY = Object.freeze([
|
||||
note: 'Official keyless endpoint; the state catalogue page refused automated reads, so no licence is quoted. Same basis as Metro Transit and OVapi. Speeds are m/s. The server picks its encoding from Accept, hence the override.',
|
||||
},
|
||||
defaultMode: 'bus',
|
||||
routeMode: adelaideMetroRouteMode,
|
||||
}),
|
||||
transitFeed({
|
||||
id: 'marta-atlanta',
|
||||
|
||||
@@ -396,6 +396,31 @@ test('a feed with rider-facing route ids is left alone', () => {
|
||||
assert.equal(transitRouteLabel(null, '7'), '7');
|
||||
});
|
||||
|
||||
test('TransLink route keys lose their GTFS version; Cairns loses its C prefix', () => {
|
||||
// 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');
|
||||
assert.equal(transitRouteLabel(seq, 'BNVL-5'), 'BNVL', 'a rail line code');
|
||||
assert.equal(
|
||||
transitRouteLabel(seq, 'CLSH-5'),
|
||||
'CLSH',
|
||||
'a rail code starting with C is not a Cairns bus',
|
||||
);
|
||||
assert.equal(transitRouteLabel(seq, 'F1-18'), 'F1');
|
||||
const cairns = getTransitFeed('translink-cairns');
|
||||
assert.equal(transitRouteLabel(cairns, 'C123-33'), '123');
|
||||
assert.equal(transitRouteLabel(cairns, 'C110-33'), '110');
|
||||
assert.equal(
|
||||
transitRouteLabel(cairns, '143W-33'),
|
||||
'143W',
|
||||
'a variant keeps its letter',
|
||||
);
|
||||
assert.equal(transitRouteLabel(cairns, 'C123'), '123', 'an unversioned key');
|
||||
assert.equal(transitRouteLabel(seq, '600'), '600', 'nothing to strip');
|
||||
assert.equal(transitRouteLabel(seq, null), null);
|
||||
});
|
||||
|
||||
test('the feeds whose licences are accepted by use are switched on', () => {
|
||||
// Barrie and YRT each ask for acceptance through a form, and each licence
|
||||
// also says that using the data is itself acceptance. That reading was
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { transitFeedCredit } from './dataCredits.js';
|
||||
import {
|
||||
getTransitFeed,
|
||||
publicTransitCatalog,
|
||||
transitFeedsInRange,
|
||||
transitModeFor,
|
||||
transitModeResolved,
|
||||
} from './transitFeeds.js';
|
||||
|
||||
// Route ids below are as published in the live feeds and the operators'
|
||||
// static routes.txt (checked 16 Oct 2026).
|
||||
|
||||
test('TransLink Cairns is routable and each TransLink feed covers its own city', () => {
|
||||
const cairns = getTransitFeed('translink-cairns');
|
||||
assert.equal(
|
||||
cairns.url,
|
||||
'https://gtfsrt.api.translink.com.au/api/realtime/CNS/VehiclePositions',
|
||||
);
|
||||
const ids = (lat, lon) => transitFeedsInRange(lat, lon).map((f) => f.id);
|
||||
assert.deepEqual(ids(-27.4698, 153.0251), ['translink-seq']);
|
||||
assert.deepEqual(ids(-16.9186, 145.7781), ['translink-cairns']);
|
||||
assert.deepEqual(ids(-37.8136, 144.9631), [], 'Melbourne has no feed');
|
||||
});
|
||||
|
||||
test('TransLink route ids resolve rail, light rail and ferries; buses stay a default', () => {
|
||||
const seq = getTransitFeed('translink-seq');
|
||||
const cases = [
|
||||
['BRBN-5187', 'rail'],
|
||||
['SHCL-5187', 'rail'],
|
||||
['RPIP-5201', 'rail'],
|
||||
['L1-5029', 'tram'],
|
||||
['F1-4055', 'ferry'],
|
||||
['F23-4055', 'ferry'],
|
||||
['F50-4430', 'ferry'],
|
||||
['SMBI-3779', 'ferry'],
|
||||
];
|
||||
for (const [routeId, mode] of cases) {
|
||||
assert.equal(transitModeFor(seq, routeId), mode, routeId);
|
||||
assert.equal(transitModeResolved(seq, routeId), true, routeId);
|
||||
}
|
||||
// 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));
|
||||
}
|
||||
const cairns = getTransitFeed('translink-cairns');
|
||||
assert.equal(transitModeFor(cairns, 'C111-5061'), 'bus');
|
||||
assert.equal(transitModeResolved(cairns, 'C111-5061'), false);
|
||||
});
|
||||
|
||||
test('Adelaide Metro route ids resolve trains, trams and the SeaLink ferry', () => {
|
||||
const adelaide = getTransitFeed('adelaide-metro');
|
||||
const cases = [
|
||||
['BEL', 'rail'],
|
||||
['GAWC', 'rail'],
|
||||
['OUTHA', 'rail'],
|
||||
['SEAFRD', 'rail'],
|
||||
['PTDOCK', 'rail'],
|
||||
['BTANIC', 'tram'],
|
||||
['GLNELG', 'tram'],
|
||||
['FESTVL', 'tram'],
|
||||
['SEALNK', 'ferry'],
|
||||
];
|
||||
for (const [routeId, mode] of cases) {
|
||||
assert.equal(transitModeFor(adelaide, routeId), mode, routeId);
|
||||
assert.equal(transitModeResolved(adelaide, routeId), true, routeId);
|
||||
}
|
||||
// All-letter bus routes exist (INDSTA/INDSTB), so letters alone are not rail.
|
||||
for (const routeId of ['100', 'G10', 'H33C', 'INDSTA', 'T721', null]) {
|
||||
assert.equal(transitModeFor(adelaide, routeId), 'bus', String(routeId));
|
||||
assert.equal(
|
||||
transitModeResolved(adelaide, routeId),
|
||||
false,
|
||||
String(routeId),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('TransLink feeds credit the operator and department as text', () => {
|
||||
const credit = (id) =>
|
||||
transitFeedCredit(publicTransitCatalog().find((feed) => feed.id === id))
|
||||
.html;
|
||||
for (const id of ['translink-seq', 'translink-cairns']) {
|
||||
assert.match(
|
||||
credit(id),
|
||||
/^Transit \(Translink, Department of Transport and Main Roads\): <a href="https:\/\/translink\.com\.au\/about-translink\/open-data"[^>]*>CC BY 4\.0<\/a>$/,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('DATA_SOURCES documents the TransLink feeds in the transit row style', () => {
|
||||
const rows = readFileSync(
|
||||
new URL('../../DATA_SOURCES.md', import.meta.url),
|
||||
'utf8',
|
||||
).split('\n');
|
||||
const translink = rows.find((line) => line.startsWith('| **TransLink**'));
|
||||
assert.match(translink, /South East Queensland and Cairns/);
|
||||
assert.match(translink, /open realtime vehicle data/);
|
||||
assert.match(
|
||||
translink,
|
||||
/published for developer use and not against their use/,
|
||||
);
|
||||
assert.doesNotMatch(translink, /licen[cs]e|CC BY|terms/i);
|
||||
});
|
||||
Reference in new issue
Block a user