diff --git a/gtfs-realtime/proto/gtfs-realtime.proto b/gtfs-realtime/proto/gtfs-realtime.proto index a65f5397f..f371024a4 100644 --- a/gtfs-realtime/proto/gtfs-realtime.proto +++ b/gtfs-realtime/proto/gtfs-realtime.proto @@ -103,6 +103,10 @@ message FeedEntity { optional TripUpdate trip_update = 3; optional VehiclePosition vehicle = 4; optional Alert alert = 5; + optional Trip trip = 6; + optional Shape shape = 7; + optional Route route = 8; + optional Stop stop = 9; // The extensions namespace allows 3rd-party developers to extend the // GTFS Realtime Specification in order to add and evaluate new features and @@ -185,6 +189,8 @@ message TripUpdate { // To specify a completely certain prediction, set its uncertainty to 0. optional int32 uncertainty = 3; + optional int64 schedule_time = 4; + // The extensions namespace allows 3rd-party developers to extend the // GTFS Realtime Specification in order to add and evaluate new features // and modifications to the spec. @@ -242,6 +248,8 @@ message TripUpdate { optional ScheduleRelationship schedule_relationship = 5 [default = SCHEDULED]; + optional StopTimeProperties stop_time_properties = 6; + // The extensions namespace allows 3rd-party developers to extend the // GTFS Realtime Specification in order to add and evaluate new features // and modifications to the spec. @@ -295,6 +303,12 @@ message TripUpdate { // NOTE: This field is still experimental, and subject to change. It may be // formally adopted in the future. optional int32 delay = 5; + optional TripProperties trip_properties = 6; + optional VehicleProperties vehicle_properties = 7; + // Defines which trip_ids (defined via GTFS-NewTrips) are replacing this trip. + // This is for information only and doesn’t cancel the original trip. If this + // field is populated, schedule_relationship for this trip must be CANCELED. + repeated string replaced_by_trip_id = 8; // The extensions namespace allows 3rd-party developers to extend the // GTFS Realtime Specification in order to add and evaluate new features and @@ -607,7 +621,7 @@ message TripDescriptor { // An extra trip that was added in addition to a running schedule, for // example, to replace a broken vehicle or to respond to sudden passenger // load. - ADDED = 1; + ADDED = 1 [deprecated = true]; // A trip that is running with no schedule associated to it (GTFS frequencies.txt exact_times=0). // Trips with ScheduleRelationship=UNSCHEDULED must also set all StopTimeUpdates.ScheduleRelationship=UNSCHEDULED. @@ -618,6 +632,8 @@ message TripDescriptor { // Should not be used - for backwards-compatibility only. REPLACEMENT = 5 [deprecated=true]; + + DUPLICATED = 6; } optional ScheduleRelationship schedule_relationship = 4; @@ -717,3 +733,282 @@ message TranslatedString { // The following extension IDs are reserved for private use by any organization. extensions 9000 to 9999; } + +// All messages below this comment are added in order to reflect the changes v3.1 of GTFS-ServiceChanges provide + +// Provides the updated properties for the trip. +message TripProperties { + // Identifies a trip. + optional string trip_id = 1; + // Service date on which the trip will be run in YYYYMMDD format. + optional string start_date = 2; + // Departure start time of the trip when it’s duplicated. + optional string start_time = 3; + // Refers to a route defined in the GTFS. + optional string route_id = 4; + // Text that appears on signage identifying the trip's destination to riders. + optional TranslatedString trip_headsign = 5; + // Public facing text used to identify the trip to riders. + optional TranslatedString trip_short_name = 6; + // Identifies the block to which the trip belongs. + optional string block_id = 7; + // Identifies a geospatial shape describing the vehicle travel path for a trip. + optional string shape_id = 8; +} + +// Provides the updated properties for the vehicle. +message VehicleProperties { + + // Indicates wheelchair accessibility. + optional WheelchairAccessibleStatus wheelchair_accessible = 1 [default = UNKNOWN_WHEELCHAIR_ACCESSIBILITY]; + // Indicates whether bikes are allowed or not. + optional BikesAllowedStatus bikes_allowed = 2 [default = UNKNOWN_BIKES_ALLOWANCE]; + + // Options for wheelchair_accessible: + // 0 - No accessibility information for the trip. + // 1 - Vehicle being used on this particular trip can accommodate at least one rider in a wheelchair. + // 2 - No riders in wheelchairs can be accommodated on this trip. + enum WheelchairAccessibleStatus { + UNKNOWN_WHEELCHAIR_ACCESSIBILITY = 0; + WHEELCHAIR_ACCESSIBLE = 1; + NOT_WHEELCHAIR_ACCESSIBLE = 2; + } + + // Options for bikes_allowed: + // 0 - No bike information for the trip. + // 1 - Vehicle being used on this particular trip can accommodate at least one bicycle. + // 2 - No bicycles are allowed on this trip. + enum BikesAllowedStatus { + UNKNOWN_BIKES_ALLOWANCE = 0; + BIKES_ALLOWED = 1; + BIKES_NOT_ALLOWED = 2; + } +} + +// Provides the updated values for the stop time. +message StopTimeProperties { + // Refers to a stop_id defined in the GTFS. + optional string platform_id = 1; + // Text that appears on signage identifying the trip's destination to riders. + optional TranslatedString stop_headsign = 2; + // Indicates pickup method. + optional PickupType pickup_type = 3 [default = REGULAR_PICKUP]; + // Indicates drop off method. + optional DropOffType drop_off_type = 4 [default = REGULAR_DROP_OFF]; + // Actual distance traveled along the associated shape, from the first stop to the stop specified in this record. + optional float shape_dist_traveled = 5; + + // Valid options for pickup_type: + enum PickupType { + REGULAR_PICKUP = 0; + NO_PICKUP = 1; + MUST_PHONE_AGENCY_PICKUP = 2; + MUST_ASK_DRIVER_PICKUP = 3; + } + + // Valid options for drop_off_type: + enum DropOffType { + REGULAR_DROP_OFF = 0; + NO_DROP_OFF = 1; + MUST_PHONE_AGENCY_DROP_OFF = 2; + MUST_ASK_DRIVER_DROP_OFF = 3; + } +} + +// Describes new trips. +message Trip { + // Identifier of the trip. Must be different than any trip_id defined in the GTFS. + required string trip_id = 1; + // Identifies a route. + optional string route_id = 2; + // Text that appears on signage identifying the trip's destination to riders. + required TranslatedString trip_headsign = 3; + // Public facing text used to identify the trip to riders, for instance, to identify train numbers for commuter rail trip + required string trip_short_name = 4; + // Indicates the direction of travel for a trip. + optional uint32 direction_id = 5; + // Identifies the block to which the trip belongs. + optional string block_id = 6; + // Identifies a geospatial shape describing the vehicle travel path for a trip. + optional string shape_id = 7; + // Indicates wheelchair accessibility. + optional WheelchairAccessibleStatus wheelchair_accessible = 8 [default = UNKNOWN_WHEELCHAIR_ACCESSIBILITY]; + // Indicates whether bikes are allowed or not. + optional BikesAllowedStatus bikes_allowed = 9 [default = UNKNOWN_BIKES_ALLOWANCE]; + // The arrival and departure times for this trip. Entities must be ordered by stop_sequence. + repeated StopTime stop_time = 10; + // Service date(s) on which the trip will be run. Must be provided in YYYYMMDD format. + repeated string start_date = 11; + + // Options for wheelchair_accessible: + // 0 - No accessibility information for the trip. + // 1 - Vehicle being used on this particular trip can accommodate at least one rider in a wheelchair. + // 2 - No riders in wheelchairs can be accommodated on this trip. + enum WheelchairAccessibleStatus { + UNKNOWN_WHEELCHAIR_ACCESSIBILITY = 0; + WHEELCHAIR_ACCESSIBLE = 1; + NOT_WHEELCHAIR_ACCESSIBLE = 2; + } + + // Options for bikes_allowed: + // 0 - No bike information for the trip. + // 1 - Vehicle being used on this particular trip can accommodate at least one bicycle. + // 2 - No bicycles are allowed on this trip. + enum BikesAllowedStatus { + UNKNOWN_BIKES_ALLOWANCE = 0; + BIKES_ALLOWED = 1; + BIKES_NOT_ALLOWED = 2; + } +} + +// Describes the times that a vehicle arrives at and departs from stops for each updated trip +message StopTime { + // Order of stops for a particular trip. The values must increase along the trip but do not need to be consecutive. + required uint32 stop_sequence = 1; + // Arrival time at a specific stop for a specific trip on a route. + // This field must be in the format of HH:MM:SS. + required string arrival_time = 2; + // Departure time at a specific stop for a specific trip on a route. + // This field must be in the format of HH:MM:SS. + required string departure_time = 3; + // Identifies the serviced stop. + required string stop_id = 4; + // Text that appears on signage identifying the trip's destination to riders. + optional TranslatedString stop_headsign = 5; + // Indicates pickup method. + optional PickupType pickup_type = 6 [default = REGULAR_PICKUP]; + // Indicates drop off method. + optional DropOffType drop_off_type = 7 [default = REGULAR_DROP_OFF]; + // Actual distance traveled along the associated shape, from the first stop to the stop specified in this record. + optional float shape_dist_traveled = 8; + + // Valid options for pickup_type: + // 0 - Regularly scheduled pickup. + // 1 - No pickup available. + // 2 - Must phone agency to arrange pickup. + // 3 - Must coordinate with driver to arrange pickup. + enum PickupType { + REGULAR_PICKUP = 0; + NO_PICKUP = 1; + MUST_PHONE_AGENCY_PICKUP = 2; + MUST_ASK_DRIVER_PICKUP = 3; + } + + // Valid options for drop_off_type: + // 0 - Regularly scheduled drop off. + // 1 - No drop off available. + // 2 - Must phone agency to arrange drop off. + // 3 - Must coordinate with driver to arrange drop off. + enum DropOffType { + REGULAR_DROP_OFF = 0; + NO_DROP_OFF = 1; + MUST_PHONE_AGENCY_DROP_OFF = 2; + MUST_ASK_DRIVER_DROP_OFF = 3; + } +} + +// Defines a shape for a trip that has been updated. +message Shape { + // Identifier of the shape. Must be different than any shape_id defined in the GTFS. + required string shape_id = 1; + // Points in the shape. A shape must contain at least two shape points. The shape points order in this field defines their order in the shape. + repeated ShapePoint shape_point = 2; +} + +// Defines the geographical representation of a point in a shape. +message ShapePoint { + // Latitude of a shape point. Each record in shapes.txt represents a shape point used to define the shape. + required float shape_pt_lat = 1; + // Longitude of a shape point. + required float shape_pt_lon = 2; + // Actual distance traveled along the shape from the first shape point to the point specified in this record. + optional float shape_dist_traveled = 3; + // Sequence in which the shape points connect to form the shape. Values must increase along the trip but do not need to be consecutive. + required uint32 shape_pt_sequence = 4; +} + +// Describes new routes. A route is a group of trips that are displayed to riders as a single service. +message Route { + // Identifier of the route. Must be different than any route_id defined in the GTFS. + required string route_id = 1; + // Identifies a transit brand which is often synonymous with a transit agency. + required string agency_id = 2; + // Short name of a route. + optional TranslatedString route_short_name = 3; + // Full name of a route. This name is generally more descriptive than the route_short_name and often includes the route's destination or stop. + optional TranslatedString route_long_name = 4; + // Description of a route that provides useful, quality information. Do not simply duplicate the name of the route. + optional TranslatedString route_desc = 5; + // Indicates the type of transportation used on a route. + required RouteType route_type = 6; + // URL of a web page about the particular route. Should be different from the agency.agency_url value. + optional TranslatedString route_url = 7; + // Route color designation that matches public facing material. D + optional string route_color = 8; + // Legible color to use for text drawn against a background of route_color. + optional string route_text_color = 9; + // Orders the routes in a way which is ideal for presentation to customers. Routes with smaller route_sort_order values should be displayed first. + optional uint32 route_sort_order = 10; + + // Valid options for route_type: + // 0 - Tram, Streetcar, Light rail. Any light rail or street level system within a metropolitan area. + // 1 - Subway, Metro. Any underground rail system within a metropolitan area. + // 2 - Rail. Used for intercity or long-distance travel. + // 3 - Bus. Used for short- and long-distance bus routes. + // 4 - Ferry. Used for short- and long-distance boat service. + // 5 - Cable car. Used for street-level cable cars where the cable runs beneath the car. + // 6 - Gondola, Suspended cable car. Typically used for aerial cable cars where the car is suspended from the cable. + // 7 - Funicular. Any rail system designed for steep inclines. + // 11 - TROLLEY_BUS. Electric buses that draw power from overhead wires using poles. + // 12 - MONORAIL. Railway in which the track consists of a single rail or a beam. + enum RouteType { + LIGHT_RAIL = 0; + SUBWAY = 1; + RAIL = 2; + BUS = 3; + FERRY = 4; + CABLE_TRAM = 5; + AERIAL_LIFT = 6; + FUNICULAR = 7; + TROLLEY_BUS = 11; + MONORAIL = 12; + } +} + +// Describes new stops where vehicles pick up or drop off riders. +message Stop { + // Identifier of the stop. Must be different than any stop_id defines in the GTFS. + required string stop_id = 1; + // Short text or a number that identifies the location for riders. These codes are often used in phone-based transit + // information systems or printed on signage to make it easier for riders to get information for a particular location. + optional TranslatedString stop_code = 2; + // Name of the location. Use a name that people will understand in the local and tourist vernacular. + required TranslatedString stop_name = 3; + // Description of the location that provides useful, quality information. + optional TranslatedString stop_desc = 4; + // Latitude of the location. + required float stop_lat = 5; + // Longitude of the location. + required float stop_lon = 6; + // Identifies the fare zone for a stop. + optional string zone_id = 7; + // URL of a web page about the location. + optional TranslatedString stop_url = 8; + // Defines hierarchy between the different locations defined in stops.txt. + optional string parent_station = 9; + // Timezone of the location. If the location has a parent station, it inherits the parent station’s timezone instead of applying its own. + optional string stop_timezone = 10; + // Indicates whether wheelchair boardings are possible from the location. + optional WheelchairBoardingStatus wheelchair_boarding = 11 [default = UNKNOWN_WHEELCHAIR_BOARDING]; + // Level of the location. + optional string level_id = 12; + // Platform identifier for a platform stop. + optional string platform_code = 13; + + // Valid options for wheelchair_boarding: + enum WheelchairBoardingStatus { + UNKNOWN_WHEELCHAIR_BOARDING = 0; + WHEELCHAIR_ACCESSIBLE = 1; + NOT_WHEELCHAIR_ACCESSIBLE = 2; + } +}