Ví dụ về thông báo dịch vụ
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Ví dụ sau đây là bản trình bày ASCII của nguồn cấp dữ liệu Cảnh báo dịch vụ. Trong ví dụ này, cảnh báo được áp dụng cho tất cả các chuyến đi đi qua trạm dừng 16230 và các chuyến đi thuộc tuyến 219 và ghé thăm trạm dừng 16130.
Để biết thêm thông tin chi tiết về cách tạo nguồn cấp dữ liệu Cảnh báo dịch vụ, hãy xem phần Tổng quan về cảnh báo.
# header information
header {
# version of speed specification. Currently "2.0".
gtfs_realtime_version: "2.0"
# DIFFERENTIAL is unsupported. use FULL_DATASET only
incrementality: FULL_DATASET
# the moment where this dataset was generated on the server
timestamp: 1658283241
}
# multiple entities can be included in the feed
entity {
# unique identifier for the entity within the feed
id: "0"
# "type" of the entity
alert {
# multiple periods can be defined. active_period defines
# the time period that the alert is applied to the selectors
active_period {
# either start time or end time must be present
# one of them can be omitted but not both
# start time in seconds after epoch
start: 1658283241
# end time in seconds after epoch
end: 1658293845
}
# multiple selectors can be given to select the affected entities
# selectors are applied with a logical OR relationship across
# informed_entity messages along with a logical AND relationship
# for parameters in each informed_entity
informed_entity {
# valid parameters:
# agency_id, route_id, route_type, direction_id, stop_id, trip
route_id: "219"
stop_id: "16130"
}
informed_entity {
stop_id: "16230"
}
# system may use the cause and effect to judge the alert severity
# see https://support.google.com/transitpartners/answer/10104458
# cause of the alert - see gtfs-realtime.proto for valid values
cause: CONSTRUCTION
# effect of the alert - see gtfs-realtime.proto for valid values
effect: DETOUR
# the given url provides additional information
url {
# multiple languages/translations supported
translation {
# the link points to a webpage with more details of the alert
text: "http://www.sometransitagency/alerts"
# language code must be BCP-47, if defined
language: "en"
}
}
# header of the alert
header_text {
# multiple languages/translations supported
translation {
text: "Stop at Elm street is closed, temporary stop at Oak street"
language: "en"
}
}
# alert description. additional info to the header text
description_text {
# multiple languages/translations supported
translation {
text: "Due to construction at Elm street the stop is closed. The temporary stop can be found 300 meters north at Oak street"
language: "en"
}
}
}
}
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eThis document outlines an example of a Service Alert feed in the General Transit Feed Specification Realtime (GTFS-realtime) format.\u003c/p\u003e\n"],["\u003cp\u003eThe provided example demonstrates an alert affecting trips passing through stop 16230 and trips on route 219 visiting stop 16130.\u003c/p\u003e\n"],["\u003cp\u003eThe alert informs about a construction-related detour, with a temporary stop replacing the closed stop at Elm street.\u003c/p\u003e\n"],["\u003cp\u003eFurther details on creating Service Alert feeds can be found in the linked Google Transit Partner Help article.\u003c/p\u003e\n"]]],["This document details an example Service Alert feed. The feed includes header information such as version, incrementality, and timestamp. It defines an alert entity active between specified start and end times (1658283241 and 1658293845). The alert applies to trips on route 219 at stop 16130 and all trips through stop 16230. The alert's cause is \"CONSTRUCTION,\" the effect is \"DETOUR,\" and it provides a URL, header, and description with further information.\n"],null,["# Service Alert example\n\nThe following example is an ASCII representation of a Service Alert feed. In\nthis example, an alert is applied to all trips that go through stop 16230 and to\ntrips that belong to route 219 and visit stop 16130.\n\nFor more details on how to construct a Service Alert feed, see [Alerts\noverview](https://support.google.com/transitpartners/answer/10105059). \n\n # header information\n header {\n # version of speed specification. Currently \"2.0\".\n gtfs_realtime_version: \"2.0\"\n\n # DIFFERENTIAL is unsupported. use FULL_DATASET only\n incrementality: FULL_DATASET\n\n # the moment where this dataset was generated on the server\n timestamp: 1658283241\n }\n # multiple entities can be included in the feed\n entity {\n # unique identifier for the entity within the feed\n id: \"0\"\n\n # \"type\" of the entity\n alert {\n # multiple periods can be defined. active_period defines \n # the time period that the alert is applied to the selectors\n active_period {\n # either start time or end time must be present\n # one of them can be omitted but not both\n # start time in seconds after epoch\n start: 1658283241\n # end time in seconds after epoch\n end: 1658293845\n }\n\n # multiple selectors can be given to select the affected entities\n # selectors are applied with a logical OR relationship across \n # informed_entity messages along with a logical AND relationship \n # for parameters in each informed_entity\n informed_entity {\n # valid parameters:\n # agency_id, route_id, route_type, direction_id, stop_id, trip\n route_id: \"219\"\n stop_id: \"16130\"\n }\n informed_entity {\n stop_id: \"16230\"\n }\n\n # system may use the cause and effect to judge the alert severity\n # see https://support.google.com/transitpartners/answer/10104458\n # cause of the alert - see gtfs-realtime.proto for valid values\n cause: CONSTRUCTION\n # effect of the alert - see gtfs-realtime.proto for valid values\n effect: DETOUR\n\n # the given url provides additional information\n url {\n # multiple languages/translations supported\n translation {\n # the link points to a webpage with more details of the alert\n text: \"http://www.sometransitagency/alerts\"\n # language code must be BCP-47, if defined\n language: \"en\"\n }\n }\n\n # header of the alert\n header_text {\n # multiple languages/translations supported\n translation {\n text: \"Stop at Elm street is closed, temporary stop at Oak street\"\n language: \"en\"\n }\n }\n\n # alert description. additional info to the header text\n description_text {\n # multiple languages/translations supported\n translation {\n text: \"Due to construction at Elm street the stop is closed. The temporary stop can be found 300 meters north at Oak street\"\n language: \"en\"\n }\n }\n }\n }"]]