变化查证
原能力
向有效官方信息或服务方核对变化,标记受影响的行程和预订。(细化版 p.10–11)
首选项目
GTFS Realtime Bindings(Apache-2.0(绑定库))。 GTFS Realtime Bindings
匹配范围
读取运营更新和服务警报作为变化证据。
源码
GTFS Realtime Bindings · message Alert
gtfs-realtime.proto · 624–637 行。 在 GitHub 查看规范模型 · 许可证与声明
源码片段
message Alert {
// Time when the alert should be shown to the user. If missing, the
// alert will be shown as long as it appears in the feed.
// If multiple ranges are given, the alert will be shown during all of them.
// Should not be used - for backwards-compatibility only.
repeated TimeRange active_period = 1 [deprecated = true];
// Time when the alert should be shown to the user strictly for informative reasons.
// If missing, the consuming application can decide when it's appropriate to be shown.
// If multiple ranges are given, the alert will be shown during all of them.
repeated TimeRange communication_period = 2;
// Time when the services are affected by the alert. If communication_period is specified,
// every time interval in impact_period must be fully contained within at least
- // Copyright 2015 The GTFS Specifications Authors.
GTFS Realtime Bindings · message TripUpdate
gtfs-realtime.proto · 156–169 行。 在 GitHub 查看规范模型 · 许可证与声明
源码片段
message TripUpdate {
// The Trip that this message applies to. There can be at most one
// TripUpdate entity for each actual trip instance.
// If there is none, that means there is no prediction information available.
// It does *not* mean that the trip is progressing according to schedule.
required TripDescriptor trip = 1;
// Additional information on the vehicle that is serving this trip.
optional VehicleDescriptor vehicle = 3;
// Timing information for a single predicted event (either arrival or
// departure).
// Timing consists of delay and/or estimated time, and uncertainty.
// - delay should be used when the prediction is given relative to some
- // Copyright 2015 The GTFS Specifications Authors.
接口用法示意
feed = gtfs_realtime_pb2.FeedMessage(); feed.ParseFromString(payload)
实现与验收要点
官方规则和供应商实证、数据新鲜度以及无覆盖。