Stockholm Public Transport (SL) static GTFS merged with the observed arrival/departure times reported via GTFS-RT TripUpdates and ServiceAlerts, 2024 Dataset
Authors/Creators
Description
This dataset is not a snapshot or sequence of snapshots of vehicle-trip progress, but rather a daily summary of all arrival and departure observations. It is the result of us independently polling that live feed every 15 seconds throughout 2024, matching each time snapshot against the planned GTFS Regional static timetable active for that service day (including planned vehicle-trips not present in TripUpdates for unknown reasons). Thus, this dataset provides complete daily planned supply with its observed performance. In processing, we consolidate the many snapshots covering each stop visit into a single record of the observed arrival and departure time (if observed). In other words, we keep only the final observations instead of the full trip progress, or we wait for the vehicle trip to complete and keep its last streamed snapshots. This results in a significantly smaller dataset of observed arrival and departure times.
One day of data from Trafiklab's stream is about 4.5 GB, so this dataset is the result of collecting and processing 1.7 TB of data during 2024. This dataset already contains ready-to-use, per-stop-visit observed delay, arrival, and departure times across the Stockholm Region, saving users from collecting and processing raw GTFS-RT snapshots themselves. Note that the same underlying live feed (https://www.trafiklab.se/sv/api/gtfs-datasets/gtfs-regional) is also archived, unprocessed, by Trafiklab in the KODA repository (https://www.trafiklab.se/sv/api/our-apis/koda); we collected this dataset independently of KODA, so its polling interval and coverage may differ from ours, KODA is a good alternative source if you need raw feed snapshots for other operators/regions, or wish to reproduce this dataset's processing yourself.
Abstract
Coverage: 2024-01-01 to 2024-12-31 (calendar year, Europe/Stockholm operating dates).
The GTFS-RT TripUpdates and ServiceAlerts feed published by Trafiklab is a live, snapshot-based service: each request returns only the feed's current state (updated on the Trafiklab server approximately every 15 seconds). Each vehicle-trip present in the dataset is streamed with a scheduled plan, and observations are either predicted or observed depending on progress during the trip.
This dataset is not a snapshot or sequence of snapshots of vehicle-trip progress, but rather a daily summary of all arrival and departure observations. It is the result of us independently polling that live feed every 15 seconds throughout 2024, matching each time snapshot against the planned GTFS Regional static timetable active for that service day (including planned vehicle-trips not present in TripUpdates for unknown reasons). Thus, this dataset provides complete daily planned supply with its observed performance. In processing, we consolidate the many snapshots covering each stop visit into a single record of the observed arrival and departure time (if observed). In other words, we keep only the final observations instead of the full trip progress, or we wait for the vehicle trip to complete and keep its last streamed snapshots. This results in a significantly smaller dataset of observed arrival and departure times.
One day of data from Trafiklab's stream is about 4.5 GB, so this dataset is the result of collecting and processing 1.7 TB of data during 2024. This dataset already contains ready-to-use, per-stop-visit observed delay, arrival, and departure times across the Stockholm Region, saving users from collecting and processing raw GTFS-RT snapshots themselves. Note that the same underlying live feed (https://www.trafiklab.se/sv/api/gtfs-datasets/gtfs-regional) is also archived, unprocessed, by Trafiklab in the KODA repository (https://www.trafiklab.se/sv/api/our-apis/koda); we collected this dataset independently of KODA, so its polling interval and coverage may differ from ours, KODA is a good alternative source if you need raw feed snapshots for other operators/regions, or wish to reproduce this dataset's processing yourself.
Terminology
SL (Storstockholms Lokaltrafik) is Stockholm's public transit operator. GTFS (General Transit Feed Specification) is the static schedule format used for its planned timetables; GTFS-RT (GTFS Realtime) is the companion real-time feed format, used here for TripUpdates (vehicle-reported arrival/departure estimates) and Service Alerts (disruption notices).
- SL (Storstockholms Lokaltrafik): The public transport authority/operator for the Stockholm region, responsible for bus, metro, train, tram and ferry services.
- GTFS (General Transit Feed Specification): A standard file format for publishing static public transit schedules and associated geographic information (stops, routes, trips, timetables).
- GTFS-RT (GTFS Realtime): A companion format to GTFS that conveys real-time updates: vehicle positions, trip updates (predicted/observed arrival and departure times) and service alerts (disruption notices), as protocol-buffer feeds.
- TripUpdates: A GTFS-RT feed type reporting real-time predictions or observations of arrival/departure times for scheduled trips.
- Service Alerts: A GTFS-RT feed type reporting service disruptions, delays, or other notices affecting routes, trips, or stops.
- AVL (Automatic Vehicle Location): Onboard vehicle tracking used as a source for the real-time positioning/timing data merged into this dataset.
Acknowledgment
Original data source: Trafiklab (https://www.trafiklab.se)
Data collection and processing: Intelligent Mobility Lab (iMobility Lab), KTH (Matej Cebecauer and Anastasios Skoufas).
Dataset prepared by: Daniel Chaves and Matej Cebecauer, Division of Transport Planning, Department of Civil and Architectural Engineering, KTH.
Recommended acknowledgment for dataset use:
We thank Trafiklab (Trafiklab.se) for the data and the KTH iMobility Lab members who helped collect and process Trafiklab's API live-stream data into the dataset used: Matej Cebecauer, Daniel Chaves, and Anastasios Skoufas.
Table of contents
|
Dataset |
Title |
Files |
Format |
|
1 |
Observed vs. scheduled vehicle arrival/departure events (AVL + GTFS-RT TripUpdates, merged with GTFS Regional Static planned time tables) |
12 files, one per month |
CSV, gzip-compressed (.csv.gz) |
|
2 |
Raw SL GTFS-RT Service Alerts |
1 file |
Parquet (zstd) |
|
3 |
Static GTFS Regional Static reference data (Stops, Transfers, Trips, Routes) |
4 files |
CSV |
Technical info
1. Observed vs. scheduled arrival/departure events (gtfs_rt_YYYY_MM.csv.gz)
One row per (trip, stop) observation: the scheduled stop time from the static GTFS regional timetable, merged with the observed arrival/departure reported via GTFS-RT TripUpdates for that stop visit.
|
Field |
Type |
Description |
|
date |
date |
Service date the trip operated on |
|
LineNumber |
string |
Public-facing line number (e.g. "18", "323") |
|
LineID |
integer |
Numeric part of route_id — SL's internal line number |
|
route_id |
string |
Route identifier. Join key to routes.txt for full route metadata |
|
TransportMode |
string |
Mode: BUS, METRO, TRAIN, TRAM, SHIP (derived from route_type in routes.txt) |
|
direction_id |
integer (0/1) |
Direction of travel for the trip (0 = outbound, 1 = inbound) |
|
trip_id |
integer |
Trip/departure identifier on route_id. Join key to trips.txt for full trip metadata |
|
VehicleID |
integer |
Vehicle identifier, as reported in GTFS-RT TripUpdates/VehiclePositions |
|
shape_id |
integer |
Foreign key to shapes.txt (route path geometry — not included in this dataset) |
|
planned_departure_sfm |
integer (seconds) |
Scheduled trip departure time, seconds-from-midnight of the service date, from the static GTFS regional timetable |
|
planned_departure_tripupdates_sfm |
integer (seconds) |
Scheduled trip departure time, seconds-from-midnight, as carried in the merged GTFS-RT TripUpdates message |
|
stop_sequence |
integer |
Order of this stop within the trip |
|
dist_traveled |
number (meters) |
Distance traveled from the previous stop to this observed stop |
|
previous_stop_id |
integer |
stop_id of the preceding stop. Join key to stops.txt |
|
previous_StopAreaID |
integer |
Parent-station identifier of the preceding stop (stops.txt → parent_station) |
|
observed_stop_id |
integer |
stop_id of the observed/current stop. Join key to stops.txt |
|
observed_StopAreaID |
integer |
Parent-station identifier of the observed stop (stops.txt → parent_station) |
|
scheduled_arrival_time_sfm |
integer (seconds) |
Scheduled arrival time at this stop, seconds-from-midnight |
|
observed_arrival_time_sfm |
integer (seconds) |
Observed (real-time) arrival time at this stop, seconds-from-midnight |
|
observed_arrival_delay |
integer (seconds) |
Observed arrival delay vs. schedule (+ late / − early) |
|
observed_arrival_uncertainty |
integer |
GTFS-RT reported uncertainty of the observed arrival estimate |
|
scheduled_departure_time_sfm |
integer (seconds) |
Scheduled departure time from this stop, seconds-from-midnight |
|
observed_departure_time_sfm |
integer (seconds) |
Observed (real-time) departure time from this stop, seconds-from-midnight |
|
observed_departure_delay |
integer (seconds) |
Observed departure delay vs. schedule |
|
observed_departure_uncertainty |
integer |
GTFS-RT reported uncertainty of the observed departure estimate |
|
tripupdates_and_gtfs_not_merged_within_service_id |
boolean (0/1) |
Data-quality flag: 0 = static GTFS and GTFS-RT TripUpdates matched on the same service_id/service date; 1 = not matched |
|
tripupdates_not_merged_with_stoptimes_or_trip |
boolean (0/1) |
Data-quality flag: 0 = merge succeeded using stop_times/trips timing information; 1 = not matched |
|
stop_headsign |
string |
Headsign displayed at the stop for this trip |
Merge quality: a row where both tripupdates_and_gtfs_not_merged_within_service_id = 0 and tripupdates_not_merged_with_stoptimes_or_trip = 0 indicates a fully successful match between the static schedule and the real-time TripUpdates report.
2. Raw GTFS-RT Service Alerts feed (service_alerts_2024.parquet)
Unprocessed GTFS-RT Service Alerts feed, one row per (alert × informed entity) pair.
|
Field |
Type |
Description |
|
id |
bigint |
GTFS-RT alert entity ID |
|
start |
timestamp |
Alert active-period start |
|
end |
timestamp |
Alert active-period end |
|
cause |
int |
GTFS-RT Alert.Cause enum value |
|
description_text2 |
string |
Alert description text (Swedish) |
|
header_text2 |
string |
Alert header/summary text (Swedish) |
|
route_id |
string |
Affected GTFS route, if specified |
|
trip_id |
bigint |
Affected GTFS trip, if specified |
|
schedule_relationship |
smallint |
GTFS-RT TripDescriptor.ScheduleRelationship for the informed entity |
|
stop_id |
bigint |
Affected stop, if specified |
|
date_inserted |
timestamp |
When this row was captured into the database |
|
date |
int |
Capture date, YYYYMMDD |
|
alert_message_timestamp |
timestamp |
Feed message timestamp |
Row count (2024): 1,972,779. Source: Trafiklab.
This is the raw alert feed, one row per informed entity, so a single real-world incident typically spans many rows/alert IDs over its lifetime. No deduplication or incident-clustering has been applied.
3. GTFS Static data
GTFS Regional Static Data
Regional GTFS reference tables (Trafiklab GTFS Sverige 2 / GTFS Regional). Source: trafiklab.se GTFS static data overview (https://www.trafiklab.se/api/gtfs-datasets/gtfs-regional/).
The files below extract unique values from 366 daily GTFS Regional Static file feeds available during 2024 through the Trafiklab API. (https://www.trafiklab.se/sv/api/gtfs-datasets/gtfs-sweden/static-specification/). All attribute values reflect their latest occurrences; for example, if the coordinates associated with a specific "stop_id" changed during 2024, this dataset provides only the last observed coordinates. The same rule applies to all attributes when referencing GTFS Regional static files in this dataset. For exact coordinates, trip head-sign, route names, etc. active on a specific day, we refer you to the historical database KODA (https://www.trafiklab.se/sv/api/our-apis/koda/).
stops.txt
|
Field |
Type |
Description |
|
stop_id |
ID |
Identifies a stop, station or station entrance |
|
stop_name |
Text |
Name of the location, in local/tourist vernacular |
|
stop_lat |
Latitude |
Latitude of the location |
|
stop_lon |
Longitude |
Longitude of the location |
|
location_type |
Enum |
Type of location — see table below |
|
parent_station |
ID |
Defines hierarchy between locations in stops.txt — contains the stop_id of the parent location |
|
platform_code |
Text |
Platform identifier for a platform stop |
location_type values:
|
Code |
Meaning |
|
0 (or blank) |
Stop/Platform — where passengers board or disembark; called a platform when it has a parent_station |
|
1 |
Station — physical structure containing one or more platforms |
|
2 |
Entrance/Exit — where passengers enter/exit a station from the street |
routes.txt
|
Field |
Type |
Description |
|
route_id |
ID |
Identifies a route |
|
route_short_name |
Text |
Short, abstract identifier for the route (e.g. "32", "100X") |
|
route_long_name |
Text |
Full, more descriptive name of the route |
|
route_type |
Enum |
Mode of transportation used on the route — see table below |
|
route_desc |
Text |
Description providing useful, quality information about the route |
route_type values (extended/regional codes)
|
Code |
Name |
Example |
|
100 |
Railway Service |
Train traffic not assignable to a more specific category |
|
101 |
High Speed Rail Service |
SJ Snabbtåg, X2000 |
|
102 |
Long Distance Rail Service |
International (Utrikes) |
|
103 |
Inter Regional Rail Service |
SJ InterCity |
|
105 |
Sleeper Rail Service |
Night train (Nattåg), EuroNight |
|
106 |
Regional Rail Service |
County traffic (Länstrafik) |
|
401 |
Metro Service |
Metro (Tunnelbana) |
|
700 |
Bus Service |
— |
|
714 |
Rail Replacement Bus Service |
Replacement bus for train traffic |
|
900 |
Tram Service |
Trams in Göteborg |
|
1000 |
Water Transport Service |
SL Pendelbåt, Stockholm–Helsinki |
|
1501 |
Communal Taxi Service |
On-demand public transport with advance order (Förbeställningstrafik) |
trips.txt
|
Field |
Type |
Description |
|
route_id |
ID |
Identifies a route |
|
trip_id |
ID |
Identifies a trip |
|
trip_headsign |
Text |
Text on signage identifying the trip's destination to riders |
|
direction_id |
Enum |
Direction of travel for the trip — see table below |
|
shape_id |
ID |
Identifies the geospatial shape describing the vehicle's travel path |
direction_id values
|
Code |
Meaning |
|
0 |
Outbound — travel in one direction |
|
1 |
Inbound — travel in the opposite direction |
transfers.txt
|
Field |
Type |
Description |
|
from_stop_id |
ID |
Stop/station where a connection between routes begins |
|
to_stop_id |
ID |
Stop/station where a connection between routes ends |
|
transfer_type |
Enum |
Type of connection for the (from_stop_id, to_stop_id) pair — see table below |
|
min_transfer_time |
Non-negative integer |
Time, in seconds, required to permit a transfer |
|
from_trip_id |
ID |
Trip where a connection between trips starts |
|
to_trip_id |
ID |
Trip where a connection between trips ends |
transfer_type values
|
Code |
Meaning |
|
0 (or blank) |
Recommended transfer point between routes |
|
1 |
Timed transfer point — the departing vehicle waits for the arriving one |
|
2 |
Transfer requires the minimum time specified by min_transfer_time |
|
3 |
Transfers not possible between routes at this location |
Files
transfers.csv
Files
(4.0 GB)
| Name | Size | Download all |
|---|---|---|
|
md5:89c540a03343d011f9f936f75ddb740a
|
343.6 MB | Download |
|
md5:91b4ac4b37c3f6fcdaedef9beb3b52ce
|
321.2 MB | Download |
|
md5:870c1a842cfafdbb3c66a448bfa3d108
|
340.9 MB | Download |
|
md5:3123dad4bb8de10432515972487d728e
|
334.5 MB | Download |
|
md5:3c4d82dcefeb0c08ad0f1b2b26bfc71e
|
343.5 MB | Download |
|
md5:e5080438a0dba0127e66028c029ebaa9
|
316.4 MB | Download |
|
md5:956c6e0a18553aec9831428b70f45ae4
|
314.2 MB | Download |
|
md5:8c50d606c49e63a0c2e36b19a52cb7a0
|
331.8 MB | Download |
|
md5:f9655fd51f9bc97ef6c1e11172b20505
|
338.1 MB | Download |
|
md5:b5c0307fa44ec09a601a71dc80918c5d
|
349.9 MB | Download |
|
md5:f3a132892faf93257b5960bd64892870
|
324.5 MB | Download |
|
md5:077ab2c4d9a38e63921cb1a704cd70cd
|
316.8 MB | Download |
|
md5:71aa1d3d111cdd5d350b114bad8a0c4f
|
21.3 kB | Preview Download |
|
md5:1dc9997c4ad0ad39b8f71297f3297887
|
29.0 MB | Download |
|
md5:01d962818bc291a16a0797f5675d6deb
|
1.4 MB | Preview Download |
|
md5:4ea76948cad0be43ed6b220be2bb4d20
|
3.0 MB | Preview Download |
|
md5:18854bce1551d8c58d3a1f35f0f95b7e
|
17.9 MB | Preview Download |