london-cycles
收藏资源简介:
该数据集记录了伦敦自行车租赁计划(Londons cycle hire scheme)中每个自行车停靠站的15分钟快照数据,数据自2022年4月29日起从TfL BikePoint API持续收集。数据集包含两个主要部分:观测数据(observations)和站点属性数据(stations)。观测数据以Hive分区格式存储(data/year=YYYY/month=MM/day=DD/part.csv),每一行对应一个站点在某个快照时刻的状态,包含查询时间、站点ID、可用自行车数、空闲车位数和总车位数。站点属性数据(stations.csv)是版本化的,每个站点可能有多个版本,记录其在不同时间区间内的属性(如名称、坐标、安装日期等),并支持与观测数据通过站点ID和时间区间进行连接。数据规模:每天约85-95个快照(历史平均),2025年后有所下降。该数据集适用于交通分析、城市规划、时间序列预测等任务。注意:数据存在一些已知问题,如部分坐标为零、夏令时导致的日期偏移、一天内多个位置变化以及快照间隔不固定等。
This dataset contains 15-minute snapshots of each bike docking station from Londons cycle hire scheme, continuously collected from the TfL BikePoint API since April 29, 2022. The dataset consists of two main parts: observations and station attributes. Observations are stored in Hive partition format (data/year=YYYY/month=MM/day=DD/part.csv), with each row representing the status of a station at a snapshot moment, including query time, station ID, number of available bikes, number of empty docks, and total number of docks. Station attributes (stations.csv) are versioned, with each station potentially having multiple versions recording its attributes (e.g., name, coordinates, installation date) over different time intervals, and can be joined with observations via station ID and time intervals. Data volume: approximately 85-95 snapshots per day (historical average), declining after 2025. This dataset is suitable for tasks such as traffic analysis, urban planning, and time series forecasting. Note: There are known issues, such as some coordinates being zero, date offsets due to daylight saving time, multiple location changes within a day, and irregular snapshot intervals.
数据集概述:伦敦公共自行车网络使用数据
该数据集记录了伦敦公共自行车租赁系统(Santander Cycles)的实时使用情况,覆盖自 2022年4月29日 起,所有停靠站的 每15分钟 快照数据。数据来源于 TfL BikePoint API,采集代码托管于 GitHub(fferegrino/london-cycles-db)。
数据集配置
数据集包含两个配置:
- observations(观测数据):存放于
data/年份=YYYY/月份=MM/日期=DD/part.csv路径下,每行代表某个停靠站在某次快照中的状态。文件采用 Hive 分区结构,按日聚合。 - stations(站点信息):即
stations.csv文件,记录站点的版本化属性信息。
观测数据字段
| 字段名 | 类型 | 说明 |
|---|---|---|
query_time |
UTC 时间戳(秒级) | API 查询时间,同一快照内所有行相同 |
place_id |
字符串 | 站点唯一标识符(如 BikePoints_1),用于关联站点表 |
bikes |
整数 | 当前可用自行车数量 |
empty_docks |
整数 | 当前空闲停车桩数量 |
docks |
整数 | 停车桩总数 |
观测数据不直接包含经纬度坐标——这些属于站点属性,保存在 stations.csv 中,以避免重复存储造成约40%的数据膨胀。
站点信息表字段
stations.csv 为版本化表,每行对应站点属性的一个版本,有效期由 [valid_from, valid_to) 界定。空 valid_to 表示该版本仍为当前有效版本。
| 字段名 | 说明 |
|---|---|
place_id |
关联观测数据的站点标识 |
common_name |
站点可读名称 |
lat, lon |
该版本有效期内站点的经纬度 |
terminal_name |
TfL 终端标识符 |
installed, temporary |
TfL 状态标志 |
install_date, removal_date |
安装/移除日期(UTC,格式 YYYY-MM-DD),可为空 |
valid_from, valid_to |
该版本有效期的起止日期(UTC) |
版本化原因:站点属性并非静态。2022–2026 年间,34 个站点发生过坐标变更(最大移动约 82 米),31 个站点被重命名,存续站点集合也有数十个的变化。使用当前状态表将无法正确关联历史观测数据。
数据关联方式
关联观测数据与站点信息时,需按 query_time 所在日期匹配站点版本的有效区间,SQL 示例:
sql SELECT f.query_time, f.place_id, s.common_name, s.lat, s.lon, f.bikes, f.empty_docks, f.docks FROM read_csv_auto(data/**/part.csv, hive_partitioning = true) AS f JOIN read_csv_auto(stations.csv) AS s ON s.place_id = f.place_id AND s.valid_from <= CAST(f.query_time AS DATE) AND (s.valid_to IS NULL OR CAST(f.query_time AS DATE) < s.valid_to)
若仅以 place_id 关联,约 100 个拥有多个版本的站点将产生重复行。
已知数据特征与注意事项
以下为上游 API 的已知数据特性,数据集未做静默修正:
- 坐标 (0,0) 异常:TfL 曾为站
BikePoints_852(2022年)报告了零岛坐标,这类情况不会开启新版本,而是沿用最近一次已知的正确位置。 - 安装/移除日期 1 小时偏移:TfL 以毫秒时间戳上报这些字段,在英国夏令时边界存在恰好 3,600,000 毫秒(1小时)的偏移。数据集已将其转换为 UTC 日期,以吸收偏移,但少数邻近午夜的值仍可能受影响。
- 同一天两个位置:站点搬迁期间,TfL 可能在同一天报告新旧两个位置(如
BikePoints_244,2025-04-15,相距 299 米)。按天粒度的版本化会记录主要位置,因此少数观测会解析到稳定位置,而非过渡位置。 - 时间快照不固定:虽然设计为每 15 分钟一次快照,但每日快照数量变化较大,不应假设固定节奏。采集依赖 GitHub Actions 的调度,延迟触发的任务不会补采。2022–2024 年平均每天约 85–95 个快照,2025 年约 65 个,2026 年初一度低至每天约 16 个,随后修复了采集任务。
- 未记录
locked状态:该字段反映的是实时停靠状态,变化频繁(历史上共 32,794 次变更,而坐标变更仅 34 次),因此未被纳入数据集中。
许可证
数据采用 CC-BY-SA 3.0 许可证,依据 TfL 条款提供。数据来源为 TfL Open Data,其中包含 OS data © Crown copyright and database rights 2016。




