Browse Source

preliminaries for gtfs js feed reading

clementinecomputing 4 years ago
parent
commit
e4ec088e00

+ 937 - 0
experimental/gtfs-realtime.proto

@@ -0,0 +1,937 @@
+// Copyright 2015 The GTFS Specifications Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Protocol definition file for GTFS Realtime.
+//
+// GTFS Realtime lets transit agencies provide consumers with realtime
+// information about disruptions to their service (stations closed, lines not
+// operating, important delays etc), location of their vehicles and expected
+// arrival times.
+//
+// This protocol is published at:
+// https://github.com/google/transit/tree/master/gtfs-realtime
+
+syntax = "proto2";
+option java_package = "com.google.transit.realtime";
+package transit_realtime;
+
+// The contents of a feed message.
+// A feed is a continuous stream of feed messages. Each message in the stream is
+// obtained as a response to an appropriate HTTP GET request.
+// A realtime feed is always defined with relation to an existing GTFS feed.
+// All the entity ids are resolved with respect to the GTFS feed.
+// Note that "required" and "optional" as stated in this file refer to Protocol
+// Buffer cardinality, not semantic cardinality.  See reference.md at
+// https://github.com/google/transit/tree/master/gtfs-realtime for field
+// semantic cardinality.
+message FeedMessage {
+  // Metadata about this feed and feed message.
+  required FeedHeader header = 1;
+
+  // Contents of the feed.
+  repeated FeedEntity entity = 2;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// Metadata about a feed, included in feed messages.
+message FeedHeader {
+  // Version of the feed specification.
+  // The current version is 2.0.  Valid versions are "2.0", "1.0".
+  required string gtfs_realtime_version = 1;
+
+  // Determines whether the current fetch is incremental.  Currently,
+  // DIFFERENTIAL mode is unsupported and behavior is unspecified for feeds
+  // that use this mode.  There are discussions on the GTFS Realtime mailing
+  // list around fully specifying the behavior of DIFFERENTIAL mode and the
+  // documentation will be updated when those discussions are finalized.
+  enum Incrementality {
+    FULL_DATASET = 0;
+    DIFFERENTIAL = 1;
+  }
+  optional Incrementality incrementality = 2 [default = FULL_DATASET];
+
+  // This timestamp identifies the moment when the content of this feed has been
+  // created (in server time). In POSIX time (i.e., number of seconds since
+  // January 1st 1970 00:00:00 UTC).
+  optional uint64 timestamp = 3;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// A definition (or update) of an entity in the transit feed.
+message FeedEntity {
+  // The ids are used only to provide incrementality support. The id should be
+  // unique within a FeedMessage. Consequent FeedMessages may contain
+  // FeedEntities with the same id. In case of a DIFFERENTIAL update the new
+  // FeedEntity with some id will replace the old FeedEntity with the same id
+  // (or delete it - see is_deleted below).
+  // The actual GTFS entities (e.g. stations, routes, trips) referenced by the
+  // feed must be specified by explicit selectors (see EntitySelector below for
+  // more info).
+  required string id = 1;
+
+  // Whether this entity is to be deleted. Relevant only for incremental
+  // fetches.
+  optional bool is_deleted = 2 [default = false];
+
+  // Data about the entity itself. Exactly one of the following fields must be
+  // present (unless the entity is being deleted).
+  optional TripUpdate trip_update = 3;
+  optional VehiclePosition vehicle = 4;
+  optional Alert alert = 5;
+
+  // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+  optional Shape shape = 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+//
+// Entities used in the feed.
+//
+
+// Realtime update of the progress of a vehicle along a trip.
+// Depending on the value of ScheduleRelationship, a TripUpdate can specify:
+// - A trip that proceeds along the schedule.
+// - A trip that proceeds along a route but has no fixed schedule.
+// - A trip that have been added or removed with regard to schedule.
+//
+// The updates can be for future, predicted arrival/departure events, or for
+// past events that already occurred.
+// Normally, updates should get more precise and more certain (see
+// uncertainty below) as the events gets closer to current time.
+// Even if that is not possible, the information for past events should be
+// precise and certain. In particular, if an update points to time in the past
+// but its update's uncertainty is not 0, the client should conclude that the
+// update is a (wrong) prediction and that the trip has not completed yet.
+//
+// Note that the update can describe a trip that is already completed.
+// To this end, it is enough to provide an update for the last stop of the trip.
+// If the time of that is in the past, the client will conclude from that that
+// the whole trip is in the past (it is possible, although inconsequential, to
+// also provide updates for preceding stops).
+// This option is most relevant for a trip that has completed ahead of schedule,
+// but according to the schedule, the trip is still proceeding at the current
+// time. Removing the updates for this trip could make the client assume
+// that the trip is still proceeding.
+// Note that the feed provider is allowed, but not required, to purge past
+// updates - this is one case where this would be practically useful.
+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
+  //   existing schedule in GTFS.
+  // - time should be given whether there is a predicted schedule or not. If
+  //   both time and delay are specified, time will take precedence
+  //   (although normally, time, if given for a scheduled trip, should be
+  //   equal to scheduled time in GTFS + delay).
+  //
+  // Uncertainty applies equally to both time and delay.
+  // The uncertainty roughly specifies the expected error in true delay (but
+  // note, we don't yet define its precise statistical meaning). It's possible
+  // for the uncertainty to be 0, for example for trains that are driven under
+  // computer timing control.
+  message StopTimeEvent {
+    // Delay (in seconds) can be positive (meaning that the vehicle is late) or
+    // negative (meaning that the vehicle is ahead of schedule). Delay of 0
+    // means that the vehicle is exactly on time.
+    optional int32 delay = 1;
+
+    // Event as absolute time.
+    // In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
+    // UTC).
+    optional int64 time = 2;
+
+    // If uncertainty is omitted, it is interpreted as unknown.
+    // If the prediction is unknown or too uncertain, the delay (or time) field
+    // should be empty. In such case, the uncertainty field is ignored.
+    // To specify a completely certain prediction, set its uncertainty to 0.
+    optional int32 uncertainty = 3;
+
+    // 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.
+    extensions 1000 to 1999;
+
+    // The following extension IDs are reserved for private use by any organization.
+    extensions 9000 to 9999;
+  }
+
+  // Realtime update for arrival and/or departure events for a given stop on a
+  // trip. Updates can be supplied for both past and future events.
+  // The producer is allowed, although not required, to drop past events.
+  message StopTimeUpdate {
+    // The update is linked to a specific stop either through stop_sequence or
+    // stop_id, so one of the fields below must necessarily be set.
+    // See the documentation in TripDescriptor for more information.
+
+    // Must be the same as in stop_times.txt in the corresponding GTFS feed.
+    optional uint32 stop_sequence = 1;
+    // Must be the same as in stops.txt in the corresponding GTFS feed.
+    optional string stop_id = 4;
+
+    optional StopTimeEvent arrival = 2;
+    optional StopTimeEvent departure = 3;
+
+    // Expected occupancy after departure from the given stop.
+    // Should be provided only for future stops.
+    // In order to provide departure_occupancy_status without either arrival or
+    // departure StopTimeEvents, ScheduleRelationship should be set to NO_DATA. 
+    optional VehiclePosition.OccupancyStatus departure_occupancy_status = 7;
+    
+    // The relation between the StopTimeEvents and the static schedule.
+    enum ScheduleRelationship {
+      // The vehicle is proceeding in accordance with its static schedule of
+      // stops, although not necessarily according to the times of the schedule.
+      // At least one of arrival and departure must be provided. If the schedule
+      // for this stop contains both arrival and departure times then so must
+      // this update. Frequency-based trips (GTFS frequencies.txt with exact_times = 0)
+      // should not have a SCHEDULED value and should use UNSCHEDULED instead.
+      SCHEDULED = 0;
+
+      // The stop is skipped, i.e., the vehicle will not stop at this stop.
+      // Arrival and departure are optional.
+      SKIPPED = 1;
+
+      // No StopTimeEvents are given for this stop.
+      // The main intention for this value is to give time predictions only for
+      // part of a trip, i.e., if the last update for a trip has a NO_DATA
+      // specifier, then StopTimeEvents for the rest of the stops in the trip
+      // are considered to be unspecified as well.
+      // Neither arrival nor departure should be supplied.
+      NO_DATA = 2;
+
+      // The vehicle is operating a trip defined in GTFS frequencies.txt with exact_times = 0.
+      // This value should not be used for trips that are not defined in GTFS frequencies.txt,
+      // or trips in GTFS frequencies.txt with exact_times = 1. Trips containing StopTimeUpdates
+      // with ScheduleRelationship=UNSCHEDULED must also set TripDescriptor.ScheduleRelationship=UNSCHEDULED.
+      // NOTE: This field is still experimental, and subject to change. It may be
+      // formally adopted in the future.
+      UNSCHEDULED = 3;
+    }
+    optional ScheduleRelationship schedule_relationship = 5
+        [default = SCHEDULED];
+
+    // Provides the updated values for the stop time.
+    // NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
+    message StopTimeProperties {
+      // Supports real-time stop assignments. Refers to a stop_id defined in the GTFS stops.txt.
+      // The new assigned_stop_id should not result in a significantly different trip experience for the end user than
+      // the stop_id defined in GTFS stop_times.txt. In other words, the end user should not view this new stop_id as an
+      // "unusual change" if the new stop was presented within an app without any additional context.
+      // For example, this field is intended to be used for platform assignments by using a stop_id that belongs to the
+      // same station as the stop originally defined in GTFS stop_times.txt.
+      // To assign a stop without providing any real-time arrival or departure predictions, populate this field and set
+      // StopTimeUpdate.schedule_relationship = NO_DATA.
+      // If this field is populated, it is preferred to omit `StopTimeUpdate.stop_id` and use only `StopTimeUpdate.stop_sequence`. If
+      // `StopTimeProperties.assigned_stop_id` and `StopTimeUpdate.stop_id` are populated, `StopTimeUpdate.stop_id` must match `assigned_stop_id`.
+      // Platform assignments should be reflected in other GTFS-realtime fields as well
+      // (e.g., `VehiclePosition.stop_id`).
+      // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+      optional string assigned_stop_id = 1;
+
+      // 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.
+      extensions 1000 to 1999;
+
+      // The following extension IDs are reserved for private use by any organization.
+      extensions 9000 to 9999;
+    }
+
+    // Realtime updates for certain properties defined within GTFS stop_times.txt
+    // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+    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.
+    extensions 1000 to 1999;
+
+    // The following extension IDs are reserved for private use by any organization.
+    extensions 9000 to 9999;
+  }
+
+  // Updates to StopTimes for the trip (both future, i.e., predictions, and in
+  // some cases, past ones, i.e., those that already happened).
+  // The updates must be sorted by stop_sequence, and apply for all the
+  // following stops of the trip up to the next specified one.
+  //
+  // Example 1:
+  // For a trip with 20 stops, a StopTimeUpdate with arrival delay and departure
+  // delay of 0 for stop_sequence of the current stop means that the trip is
+  // exactly on time.
+  //
+  // Example 2:
+  // For the same trip instance, 3 StopTimeUpdates are provided:
+  // - delay of 5 min for stop_sequence 3
+  // - delay of 1 min for stop_sequence 8
+  // - delay of unspecified duration for stop_sequence 10
+  // This will be interpreted as:
+  // - stop_sequences 3,4,5,6,7 have delay of 5 min.
+  // - stop_sequences 8,9 have delay of 1 min.
+  // - stop_sequences 10,... have unknown delay.
+  repeated StopTimeUpdate stop_time_update = 2;
+
+  // The most recent moment at which the vehicle's real-time progress was measured
+  // to estimate StopTimes in the future. When StopTimes in the past are provided,
+  // arrival/departure times may be earlier than this value. In POSIX
+  // time (i.e., the number of seconds since January 1st 1970 00:00:00 UTC).
+  optional uint64 timestamp = 4;
+
+  // The current schedule deviation for the trip.  Delay should only be
+  // specified when the prediction is given relative to some existing schedule
+  // in GTFS.
+  //
+  // Delay (in seconds) can be positive (meaning that the vehicle is late) or
+  // negative (meaning that the vehicle is ahead of schedule). Delay of 0
+  // means that the vehicle is exactly on time.
+  //
+  // Delay information in StopTimeUpdates take precedent of trip-level delay
+  // information, such that trip-level delay is only propagated until the next
+  // stop along the trip with a StopTimeUpdate delay value specified.
+  //
+  // Feed providers are strongly encouraged to provide a TripUpdate.timestamp
+  // value indicating when the delay value was last updated, in order to
+  // evaluate the freshness of the data.
+  //
+  // NOTE: This field is still experimental, and subject to change. It may be
+  // formally adopted in the future.
+  optional int32 delay = 5;
+
+  // Defines updated properties of the trip, such as a new shape_id when there is a detour. Or defines the
+  // trip_id, start_date, and start_time of a DUPLICATED trip. 
+  // NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
+  message TripProperties {
+    // Defines the identifier of a new trip that is a duplicate of an existing trip defined in (CSV) GTFS trips.txt
+    // but will start at a different service date and/or time (defined using the TripProperties.start_date and
+    // TripProperties.start_time fields). See definition of trips.trip_id in (CSV) GTFS. Its value must be different
+    // than the ones used in the (CSV) GTFS. Required if schedule_relationship=DUPLICATED, otherwise this field must not
+    // be populated and will be ignored by consumers.
+    // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional string trip_id = 1;
+    // Service date on which the DUPLICATED trip will be run, in YYYYMMDD format. Required if
+    // schedule_relationship=DUPLICATED, otherwise this field must not be populated and will be ignored by consumers.
+    // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional string start_date = 2;
+    // Defines the departure start time of the trip when it’s duplicated. See definition of stop_times.departure_time
+    // in (CSV) GTFS. Scheduled arrival and departure times for the duplicated trip are calculated based on the offset
+    // between the original trip departure_time and this field. For example, if a GTFS trip has stop A with a
+    // departure_time of 10:00:00 and stop B with departure_time of 10:01:00, and this field is populated with the value
+    // of 10:30:00, stop B on the duplicated trip will have a scheduled departure_time of 10:31:00. Real-time prediction
+    // delay values are applied to this calculated schedule time to determine the predicted time. For example, if a
+    // departure delay of 30 is provided for stop B, then the predicted departure time is 10:31:30. Real-time
+    // prediction time values do not have any offset applied to them and indicate the predicted time as provided.
+    // For example, if a departure time representing 10:31:30 is provided for stop B, then the predicted departure time
+    // is 10:31:30. This field is required if schedule_relationship is DUPLICATED, otherwise this field must not be
+    // populated and will be ignored by consumers.
+    // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional string start_time = 3;
+    // Specifies the shape of the vehicle travel path when the trip shape differs from the shape specified in
+    // (CSV) GTFS or to specify it in real-time when it's not provided by (CSV) GTFS, such as a vehicle that takes differing
+    // paths based on rider demand. See definition of trips.shape_id in (CSV) GTFS. If a shape is neither defined in (CSV) GTFS
+    // nor in real-time, the shape is considered unknown. This field can refer to a shape defined in the (CSV) GTFS in shapes.txt
+    // or a Shape in the (protobuf) real-time feed. The order of stops (stop sequences) for this trip must remain the same as
+    // (CSV) GTFS. Stops that are a part of the original trip but will no longer be made, such as when a detour occurs, should
+    // be marked as schedule_relationship=SKIPPED.
+    // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future. 
+    optional string shape_id = 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.
+    extensions 1000 to 1999;
+
+    // The following extension IDs are reserved for private use by any organization.
+    extensions 9000 to 9999;
+  }
+  optional TripProperties trip_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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// Realtime positioning information for a given vehicle.
+message VehiclePosition {
+  // The Trip that this vehicle is serving.
+  // Can be empty or partial if the vehicle can not be identified with a given
+  // trip instance.
+  optional TripDescriptor trip = 1;
+
+  // Additional information on the vehicle that is serving this trip.
+  optional VehicleDescriptor vehicle = 8;
+
+  // Current position of this vehicle.
+  optional Position position = 2;
+
+  // The stop sequence index of the current stop. The meaning of
+  // current_stop_sequence (i.e., the stop that it refers to) is determined by
+  // current_status.
+  // If current_status is missing IN_TRANSIT_TO is assumed.
+  optional uint32 current_stop_sequence = 3;
+  // Identifies the current stop. The value must be the same as in stops.txt in
+  // the corresponding GTFS feed.
+  optional string stop_id = 7;
+
+  enum VehicleStopStatus {
+    // The vehicle is just about to arrive at the stop (on a stop
+    // display, the vehicle symbol typically flashes).
+    INCOMING_AT = 0;
+
+    // The vehicle is standing at the stop.
+    STOPPED_AT = 1;
+
+    // The vehicle has departed and is in transit to the next stop.
+    IN_TRANSIT_TO = 2;
+  }
+  // The exact status of the vehicle with respect to the current stop.
+  // Ignored if current_stop_sequence is missing.
+  optional VehicleStopStatus current_status = 4 [default = IN_TRANSIT_TO];
+
+  // Moment at which the vehicle's position was measured. In POSIX time
+  // (i.e., number of seconds since January 1st 1970 00:00:00 UTC).
+  optional uint64 timestamp = 5;
+
+  // Congestion level that is affecting this vehicle.
+  enum CongestionLevel {
+    UNKNOWN_CONGESTION_LEVEL = 0;
+    RUNNING_SMOOTHLY = 1;
+    STOP_AND_GO = 2;
+    CONGESTION = 3;
+    SEVERE_CONGESTION = 4;  // People leaving their cars.
+  }
+  optional CongestionLevel congestion_level = 6;
+
+  // The state of passenger occupancy for the vehicle or carriage.
+  // Individual producers may not publish all OccupancyStatus values. Therefore, consumers
+  // must not assume that the OccupancyStatus values follow a linear scale.
+  // Consumers should represent OccupancyStatus values as the state indicated 
+  // and intended by the producer. Likewise, producers must use OccupancyStatus values that
+  // correspond to actual vehicle occupancy states.
+  // For describing passenger occupancy levels on a linear scale, see `occupancy_percentage`.
+  // This field is still experimental, and subject to change. It may be formally adopted in the future.
+  enum OccupancyStatus {
+    // The vehicle or carriage is considered empty by most measures, and has few or no
+    // passengers onboard, but is still accepting passengers.
+    EMPTY = 0;
+
+    // The vehicle or carriage has a large number of seats available.
+    // The amount of free seats out of the total seats available to be
+    // considered large enough to fall into this category is determined at the
+    // discretion of the producer.
+    MANY_SEATS_AVAILABLE = 1;
+
+    // The vehicle or carriage has a relatively small number of seats available.
+    // The amount of free seats out of the total seats available to be
+    // considered small enough to fall into this category is determined at the
+    // discretion of the feed producer.
+    FEW_SEATS_AVAILABLE = 2;
+
+    // The vehicle or carriage can currently accommodate only standing passengers.
+    STANDING_ROOM_ONLY = 3;
+
+    // The vehicle or carriage can currently accommodate only standing passengers
+    // and has limited space for them.
+    CRUSHED_STANDING_ROOM_ONLY = 4;
+
+    // The vehicle or carriage is considered full by most measures, but may still be
+    // allowing passengers to board.
+    FULL = 5;
+
+    // The vehicle or carriage is not accepting passengers, but usually accepts passengers for boarding.
+    NOT_ACCEPTING_PASSENGERS = 6;
+
+    // The vehicle or carriage doesn't have any occupancy data available at that time.
+    NO_DATA_AVAILABLE = 7;
+
+    // The vehicle or carriage is not boardable and never accepts passengers.
+    // Useful for special vehicles or carriages (engine, maintenance carriage, etc…).
+    NOT_BOARDABLE = 8;
+
+  }
+  // If multi_carriage_status is populated with per-carriage OccupancyStatus,
+  // then this field should describe the entire vehicle with all carriages accepting passengers considered.
+  optional OccupancyStatus occupancy_status = 9;
+
+  // A percentage value indicating the degree of passenger occupancy in the vehicle.
+  // The values are represented as an integer without decimals. 0 means 0% and 100 means 100%.
+  // The value 100 should represent the total maximum occupancy the vehicle was designed for,
+  // including both seated and standing capacity, and current operating regulations allow.
+  // The value may exceed 100 if there are more passengers than the maximum designed capacity.
+  // The precision of occupancy_percentage should be low enough that individual passengers cannot be tracked boarding or alighting the vehicle.
+  // If multi_carriage_status is populated with per-carriage occupancy_percentage, 
+  // then this field should describe the entire vehicle with all carriages accepting passengers considered.
+  // This field is still experimental, and subject to change. It may be formally adopted in the future.
+  optional uint32 occupancy_percentage = 10;
+
+  // Carriage specific details, used for vehicles composed of several carriages
+  // This message/field is still experimental, and subject to change. It may be formally adopted in the future.
+  message CarriageDetails {
+
+    // Identification of the carriage. Should be unique per vehicle.
+    optional string id = 1;
+
+    // User visible label that may be shown to the passenger to help identify
+    // the carriage. Example: "7712", "Car ABC-32", etc...
+    // This message/field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional string label = 2;
+
+    // Occupancy status for this given carriage, in this vehicle
+    // This message/field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional OccupancyStatus occupancy_status = 3 [default = NO_DATA_AVAILABLE];
+
+    // Occupancy percentage for this given carriage, in this vehicle.
+    // Follows the same rules as "VehiclePosition.occupancy_percentage"
+    // -1 in case data is not available for this given carriage (as protobuf defaults to 0 otherwise)
+    // This message/field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional int32 occupancy_percentage = 4 [default = -1];
+
+    // Identifies the order of this carriage with respect to the other
+    // carriages in the vehicle's list of CarriageDetails.
+    // The first carriage in the direction of travel must have a value of 1.
+    // The second value corresponds to the second carriage in the direction
+    // of travel and must have a value of 2, and so forth.
+    // For example, the first carriage in the direction of travel has a value of 1.
+    // If the second carriage in the direction of travel has a value of 3,
+    // consumers will discard data for all carriages (i.e., the multi_carriage_details field).
+    // Carriages without data must be represented with a valid carriage_sequence number and the fields 
+    // without data should be omitted (alternately, those fields could also be included and set to the "no data" values).
+    // This message/field is still experimental, and subject to change. It may be formally adopted in the future.
+    optional uint32 carriage_sequence = 5;
+
+    // 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.
+    extensions 1000 to 1999;
+
+    // The following extension IDs are reserved for private use by any organization.
+    extensions 9000 to 9999;
+  }
+
+  // Details of the multiple carriages of this given vehicle.
+  // The first occurrence represents the first carriage of the vehicle, 
+  // given the current direction of travel. 
+  // The number of occurrences of the multi_carriage_details 
+  // field represents the number of carriages of the vehicle.
+  // It also includes non boardable carriages, 
+  // like engines, maintenance carriages, etc… as they provide valuable 
+  // information to passengers about where to stand on a platform.
+  // This message/field is still experimental, and subject to change. It may be formally adopted in the future.
+  repeated CarriageDetails multi_carriage_details = 11;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// An alert, indicating some sort of incident in the public transit network.
+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.
+  repeated TimeRange active_period = 1;
+
+  // Entities whose users we should notify of this alert.
+  repeated EntitySelector informed_entity = 5;
+
+  // Cause of this alert.
+  enum Cause {
+    UNKNOWN_CAUSE = 1;
+    OTHER_CAUSE = 2;        // Not machine-representable.
+    TECHNICAL_PROBLEM = 3;
+    STRIKE = 4;             // Public transit agency employees stopped working.
+    DEMONSTRATION = 5;      // People are blocking the streets.
+    ACCIDENT = 6;
+    HOLIDAY = 7;
+    WEATHER = 8;
+    MAINTENANCE = 9;
+    CONSTRUCTION = 10;
+    POLICE_ACTIVITY = 11;
+    MEDICAL_EMERGENCY = 12;
+  }
+  optional Cause cause = 6 [default = UNKNOWN_CAUSE];
+
+  // What is the effect of this problem on the affected entity.
+  enum Effect {
+    NO_SERVICE = 1;
+    REDUCED_SERVICE = 2;
+
+    // We don't care about INsignificant delays: they are hard to detect, have
+    // little impact on the user, and would clutter the results as they are too
+    // frequent.
+    SIGNIFICANT_DELAYS = 3;
+
+    DETOUR = 4;
+    ADDITIONAL_SERVICE = 5;
+    MODIFIED_SERVICE = 6;
+    OTHER_EFFECT = 7;
+    UNKNOWN_EFFECT = 8;
+    STOP_MOVED = 9;
+    NO_EFFECT = 10;
+    ACCESSIBILITY_ISSUE = 11;
+  }
+  optional Effect effect = 7 [default = UNKNOWN_EFFECT];
+
+  // The URL which provides additional information about the alert.
+  optional TranslatedString url = 8;
+
+  // Alert header. Contains a short summary of the alert text as plain-text.
+  optional TranslatedString header_text = 10;
+
+  // Full description for the alert as plain-text. The information in the
+  // description should add to the information of the header.
+  optional TranslatedString description_text = 11;
+
+  // Text for alert header to be used in text-to-speech implementations. This field is the text-to-speech version of header_text.
+  optional TranslatedString tts_header_text = 12;
+
+  // Text for full description for the alert to be used in text-to-speech implementations. This field is the text-to-speech version of description_text.
+  optional TranslatedString tts_description_text = 13;
+
+  // Severity of this alert.
+  enum SeverityLevel {
+	UNKNOWN_SEVERITY = 1;
+	INFO = 2;
+	WARNING = 3;
+	SEVERE = 4;
+  }
+
+  optional SeverityLevel severity_level = 14 [default = UNKNOWN_SEVERITY];
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+//
+// Low level data structures used above.
+//
+
+// A time interval. The interval is considered active at time 't' if 't' is
+// greater than or equal to the start time and less than the end time.
+message TimeRange {
+  // Start time, in POSIX time (i.e., number of seconds since January 1st 1970
+  // 00:00:00 UTC).
+  // If missing, the interval starts at minus infinity.
+  optional uint64 start = 1;
+
+  // End time, in POSIX time (i.e., number of seconds since January 1st 1970
+  // 00:00:00 UTC).
+  // If missing, the interval ends at plus infinity.
+  optional uint64 end = 2;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// A position.
+message Position {
+  // Degrees North, in the WGS-84 coordinate system.
+  required float latitude = 1;
+
+  // Degrees East, in the WGS-84 coordinate system.
+  required float longitude = 2;
+
+  // Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East.
+  // This can be the compass bearing, or the direction towards the next stop
+  // or intermediate location.
+  // This should not be direction deduced from the sequence of previous
+  // positions, which can be computed from previous data.
+  optional float bearing = 3;
+
+  // Odometer value, in meters.
+  optional double odometer = 4;
+  // Momentary speed measured by the vehicle, in meters per second.
+  optional float speed = 5;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// A descriptor that identifies an instance of a GTFS trip, or all instances of
+// a trip along a route.
+// - To specify a single trip instance, the trip_id (and if necessary,
+//   start_time) is set. If route_id is also set, then it should be same as one
+//   that the given trip corresponds to.
+// - To specify all the trips along a given route, only the route_id should be
+//   set. Note that if the trip_id is not known, then stop sequence ids in
+//   TripUpdate are not sufficient, and stop_ids must be provided as well. In
+//   addition, absolute arrival/departure times must be provided.
+message TripDescriptor {
+  // The trip_id from the GTFS feed that this selector refers to.
+  // For non frequency-based trips, this field is enough to uniquely identify
+  // the trip. For frequency-based trip, start_time and start_date might also be
+  // necessary. When schedule_relationship is DUPLICATED within a TripUpdate, the trip_id identifies the trip from
+  // static GTFS to be duplicated. When schedule_relationship is DUPLICATED within a VehiclePosition, the trip_id
+  // identifies the new duplicate trip and must contain the value for the corresponding TripUpdate.TripProperties.trip_id.
+  optional string trip_id = 1;
+
+  // The route_id from the GTFS that this selector refers to.
+  optional string route_id = 5;
+
+  // The direction_id from the GTFS feed trips.txt file, indicating the
+  // direction of travel for trips this selector refers to.
+  optional uint32 direction_id = 6;
+
+  // The initially scheduled start time of this trip instance.
+  // When the trip_id corresponds to a non-frequency-based trip, this field
+  // should either be omitted or be equal to the value in the GTFS feed. When
+  // the trip_id correponds to a frequency-based trip, the start_time must be
+  // specified for trip updates and vehicle positions. If the trip corresponds
+  // to exact_times=1 GTFS record, then start_time must be some multiple
+  // (including zero) of headway_secs later than frequencies.txt start_time for
+  // the corresponding time period. If the trip corresponds to exact_times=0,
+  // then its start_time may be arbitrary, and is initially expected to be the
+  // first departure of the trip. Once established, the start_time of this
+  // frequency-based trip should be considered immutable, even if the first
+  // departure time changes -- that time change may instead be reflected in a
+  // StopTimeUpdate.
+  // Format and semantics of the field is same as that of
+  // GTFS/frequencies.txt/start_time, e.g., 11:15:35 or 25:15:35.
+  optional string start_time = 2;
+  // The scheduled start date of this trip instance.
+  // Must be provided to disambiguate trips that are so late as to collide with
+  // a scheduled trip on a next day. For example, for a train that departs 8:00
+  // and 20:00 every day, and is 12 hours late, there would be two distinct
+  // trips on the same time.
+  // This field can be provided but is not mandatory for schedules in which such
+  // collisions are impossible - for example, a service running on hourly
+  // schedule where a vehicle that is one hour late is not considered to be
+  // related to schedule anymore.
+  // In YYYYMMDD format.
+  optional string start_date = 3;
+
+  // The relation between this trip and the static schedule. If a trip is done
+  // in accordance with temporary schedule, not reflected in GTFS, then it
+  // shouldn't be marked as SCHEDULED, but likely as ADDED.
+  enum ScheduleRelationship {
+    // Trip that is running in accordance with its GTFS schedule, or is close
+    // enough to the scheduled trip to be associated with it.
+    SCHEDULED = 0;
+
+    // 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.
+    // NOTE: Currently, behavior is unspecified for feeds that use this mode. There are discussions on the GTFS GitHub
+    // [(1)](https://github.com/google/transit/issues/106) [(2)](https://github.com/google/transit/pull/221)
+    // [(3)](https://github.com/google/transit/pull/219) around fully specifying or deprecating ADDED trips and the
+    // documentation will be updated when those discussions are finalized.
+    ADDED = 1;
+
+    // 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.
+    UNSCHEDULED = 2;
+
+    // A trip that existed in the schedule but was removed.
+    CANCELED = 3;
+
+    // Should not be used - for backwards-compatibility only.
+    REPLACEMENT = 5 [deprecated=true];
+
+    // 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. Used with TripUpdate.TripProperties.trip_id, TripUpdate.TripProperties.start_date,
+    // and TripUpdate.TripProperties.start_time to copy an existing trip from static GTFS but start at a different service
+    // date and/or time. Duplicating a trip is allowed if the service related to the original trip in (CSV) GTFS
+    // (in calendar.txt or calendar_dates.txt) is operating within the next 30 days. The trip to be duplicated is
+    // identified via TripUpdate.TripDescriptor.trip_id. This enumeration does not modify the existing trip referenced by
+    // TripUpdate.TripDescriptor.trip_id - if a producer wants to cancel the original trip, it must publish a separate
+    // TripUpdate with the value of CANCELED. Trips defined in GTFS frequencies.txt with exact_times that is empty or
+    // equal to 0 cannot be duplicated. The VehiclePosition.TripDescriptor.trip_id for the new trip must contain
+    // the matching value from TripUpdate.TripProperties.trip_id and VehiclePosition.TripDescriptor.ScheduleRelationship
+    // must also be set to DUPLICATED.
+    // Existing producers and consumers that were using the ADDED enumeration to represent duplicated trips must follow
+    // the migration guide (https://github.com/google/transit/tree/master/gtfs-realtime/spec/en/examples/migration-duplicated.md)
+    // to transition to the DUPLICATED enumeration.
+    // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+    DUPLICATED = 6;
+  }
+  optional ScheduleRelationship schedule_relationship = 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// Identification information for the vehicle performing the trip.
+message VehicleDescriptor {
+  // Internal system identification of the vehicle. Should be unique per
+  // vehicle, and can be used for tracking the vehicle as it proceeds through
+  // the system.
+  optional string id = 1;
+
+  // User visible label, i.e., something that must be shown to the passenger to
+  // help identify the correct vehicle.
+  optional string label = 2;
+
+  // The license plate of the vehicle.
+  optional string license_plate = 3;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// A selector for an entity in a GTFS feed.
+message EntitySelector {
+  // The values of the fields should correspond to the appropriate fields in the
+  // GTFS feed.
+  // At least one specifier must be given. If several are given, then the
+  // matching has to apply to all the given specifiers.
+  optional string agency_id = 1;
+  optional string route_id = 2;
+  // corresponds to route_type in GTFS.
+  optional int32 route_type = 3;
+  optional TripDescriptor trip = 4;
+  optional string stop_id = 5;
+  // Corresponds to trip direction_id in GTFS trips.txt. If provided the
+  // route_id must also be provided.
+  optional uint32 direction_id = 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+// An internationalized message containing per-language versions of a snippet of
+// text or a URL.
+// One of the strings from a message will be picked up. The resolution proceeds
+// as follows:
+// 1. If the UI language matches the language code of a translation,
+//    the first matching translation is picked.
+// 2. If a default UI language (e.g., English) matches the language code of a
+//    translation, the first matching translation is picked.
+// 3. If some translation has an unspecified language code, that translation is
+//    picked.
+message TranslatedString {
+  message Translation {
+    // A UTF-8 string containing the message.
+    required string text = 1;
+    // BCP-47 language code. Can be omitted if the language is unknown or if
+    // no i18n is done at all for the feed. At most one translation is
+    // allowed to have an unspecified language tag.
+    optional string language = 2;
+
+    // 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.
+    extensions 1000 to 1999;
+
+    // The following extension IDs are reserved for private use by any organization.
+    extensions 9000 to 9999;
+  }
+  // At least one translation must be provided.
+  repeated Translation translation = 1;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}
+
+
+// Describes the physical path that a vehicle takes when it's not part of the (CSV) GTFS,
+// such as for a detour. Shapes belong to Trips, and consist of a sequence of shape points.
+// Tracing the points in order provides the path of the vehicle.  Shapes do not need to intercept
+// the location of Stops exactly, but all Stops on a trip should lie within a small distance of
+// the shape for that trip, i.e. close to straight line segments connecting the shape points
+// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
+message Shape {
+  // Identifier of the shape. Must be different than any shape_id defined in the (CSV) GTFS.
+  // This field is required as per reference.md, but needs to be specified here optional because "Required is Forever"
+  // See https://developers.google.com/protocol-buffers/docs/proto#specifying_field_rules
+  // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+  optional string shape_id = 1;
+  
+  // Encoded polyline representation of the shape. This polyline must contain at least two points.
+  // For more information about encoded polylines, see https://developers.google.com/maps/documentation/utilities/polylinealgorithm
+  // This field is required as per reference.md, but needs to be specified here optional because "Required is Forever"
+  // See https://developers.google.com/protocol-buffers/docs/proto#specifying_field_rules
+  // NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
+  optional string encoded_polyline = 2;
+
+  // 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.
+  extensions 1000 to 1999;
+
+  // The following extension IDs are reserved for private use by any organization.
+  extensions 9000 to 9999;
+}

File diff suppressed because it is too large
+ 6931 - 0
experimental/gtfs-realtime_pb.js


+ 1 - 0
experimental/pb-compile

@@ -0,0 +1 @@
+protoc gtfs-realtime.proto --js_out=import_style=commonjs,binary:.

+ 16 - 0
experimental/pb2json.js

@@ -0,0 +1,16 @@
+var jspb = require("google-protobuf");
+var goog = jspb;
+var pb = require("./gtfs-realtime_pb.js");
+
+var fs = require("fs");
+
+var payload = fs.readFileSync("./test-gtfs.pb");
+
+var fm = pb.FeedMessage.deserializeBinary( new Uint8Array(payload) );
+
+var x = fm.toObject();
+
+console.log(JSON.stringify(x));
+
+//deserializeBinary();
+//pb proto.transit_realtime.TranslatedString

+ 447 - 0
experimental/rtjs/alert.js

@@ -0,0 +1,447 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.Alert');
+goog.provide('proto.transit_realtime.Alert.Cause');
+goog.provide('proto.transit_realtime.Alert.Effect');
+goog.provide('proto.transit_realtime.Alert.SeverityLevel');
+
+goog.require('jspb.Message');
+goog.require('proto.transit_realtime.EntitySelector');
+goog.require('proto.transit_realtime.TimeRange');
+goog.require('proto.transit_realtime.TranslatedString');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.Alert = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 15, proto.transit_realtime.Alert.repeatedFields_, null);
+};
+goog.inherits(proto.transit_realtime.Alert, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.Alert.displayName = 'proto.transit_realtime.Alert';
+}
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array<number>}
+ * @const
+ */
+proto.transit_realtime.Alert.repeatedFields_ = [1,5];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.Alert.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.Alert.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.Alert} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.Alert.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    activePeriodList: jspb.Message.toObjectList(msg.getActivePeriodList(),
+    proto.transit_realtime.TimeRange.toObject, includeInstance),
+    informedEntityList: jspb.Message.toObjectList(msg.getInformedEntityList(),
+    proto.transit_realtime.EntitySelector.toObject, includeInstance),
+    cause: !msg.hasCause() ? 1 : jspb.Message.getField(msg, 6),
+    effect: !msg.hasEffect() ? 8 : jspb.Message.getField(msg, 7),
+    url: (f = msg.getUrl()) && proto.transit_realtime.TranslatedString.toObject(includeInstance, f),
+    headerText: (f = msg.getHeaderText()) && proto.transit_realtime.TranslatedString.toObject(includeInstance, f),
+    descriptionText: (f = msg.getDescriptionText()) && proto.transit_realtime.TranslatedString.toObject(includeInstance, f),
+    ttsHeaderText: (f = msg.getTtsHeaderText()) && proto.transit_realtime.TranslatedString.toObject(includeInstance, f),
+    ttsDescriptionText: (f = msg.getTtsDescriptionText()) && proto.transit_realtime.TranslatedString.toObject(includeInstance, f),
+    severityLevel: !msg.hasSeverityLevel() ? 1 : jspb.Message.getField(msg, 14)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.Alert.extensions, proto.transit_realtime.Alert.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.Alert} The clone.
+ */
+proto.transit_realtime.Alert.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.Alert} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * repeated TimeRange active_period = 1;
+ * If you change this array by adding, removing or replacing elements, or if you
+ * replace the array itself, then you must call the setter to update it.
+ * @return {!Array.<!proto.transit_realtime.TimeRange>}
+ */
+proto.transit_realtime.Alert.prototype.getActivePeriodList = function() {
+  return /** @type{!Array.<!proto.transit_realtime.TimeRange>} */ (
+    jspb.Message.getRepeatedWrapperField(this, proto.transit_realtime.TimeRange, 1));
+};
+
+
+/** @param {Array.<!proto.transit_realtime.TimeRange>} value  */
+proto.transit_realtime.Alert.prototype.setActivePeriodList = function(value) {
+  jspb.Message.setRepeatedWrapperField(this, 1, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearActivePeriodList = function() {
+  this.setActivePeriodList([]);
+};
+
+
+/**
+ * repeated EntitySelector informed_entity = 5;
+ * If you change this array by adding, removing or replacing elements, or if you
+ * replace the array itself, then you must call the setter to update it.
+ * @return {!Array.<!proto.transit_realtime.EntitySelector>}
+ */
+proto.transit_realtime.Alert.prototype.getInformedEntityList = function() {
+  return /** @type{!Array.<!proto.transit_realtime.EntitySelector>} */ (
+    jspb.Message.getRepeatedWrapperField(this, proto.transit_realtime.EntitySelector, 5));
+};
+
+
+/** @param {Array.<!proto.transit_realtime.EntitySelector>} value  */
+proto.transit_realtime.Alert.prototype.setInformedEntityList = function(value) {
+  jspb.Message.setRepeatedWrapperField(this, 5, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearInformedEntityList = function() {
+  this.setInformedEntityList([]);
+};
+
+
+/**
+ * optional Cause cause = 6;
+ * @return {proto.transit_realtime.Alert.Cause}
+ */
+proto.transit_realtime.Alert.prototype.getCause = function() {
+  return /** @type {proto.transit_realtime.Alert.Cause} */ (!this.hasCause() ? 1 : jspb.Message.getField(this, 6));
+};
+
+
+/** @param {proto.transit_realtime.Alert.Cause|undefined} value  */
+proto.transit_realtime.Alert.prototype.setCause = function(value) {
+  jspb.Message.setField(this, 6, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearCause = function() {
+  jspb.Message.setField(this, 6, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasCause = function() {
+  return jspb.Message.getField(this, 6) != null;
+};
+
+
+/**
+ * optional Effect effect = 7;
+ * @return {proto.transit_realtime.Alert.Effect}
+ */
+proto.transit_realtime.Alert.prototype.getEffect = function() {
+  return /** @type {proto.transit_realtime.Alert.Effect} */ (!this.hasEffect() ? 8 : jspb.Message.getField(this, 7));
+};
+
+
+/** @param {proto.transit_realtime.Alert.Effect|undefined} value  */
+proto.transit_realtime.Alert.prototype.setEffect = function(value) {
+  jspb.Message.setField(this, 7, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearEffect = function() {
+  jspb.Message.setField(this, 7, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasEffect = function() {
+  return jspb.Message.getField(this, 7) != null;
+};
+
+
+/**
+ * optional TranslatedString url = 8;
+ * @return {proto.transit_realtime.TranslatedString}
+ */
+proto.transit_realtime.Alert.prototype.getUrl = function() {
+  return /** @type{proto.transit_realtime.TranslatedString} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TranslatedString, 8));
+};
+
+
+/** @param {proto.transit_realtime.TranslatedString|undefined} value  */
+proto.transit_realtime.Alert.prototype.setUrl = function(value) {
+  jspb.Message.setWrapperField(this, 8, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearUrl = function() {
+  this.setUrl(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasUrl = function() {
+  return jspb.Message.getField(this, 8) != null;
+};
+
+
+/**
+ * optional TranslatedString header_text = 10;
+ * @return {proto.transit_realtime.TranslatedString}
+ */
+proto.transit_realtime.Alert.prototype.getHeaderText = function() {
+  return /** @type{proto.transit_realtime.TranslatedString} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TranslatedString, 10));
+};
+
+
+/** @param {proto.transit_realtime.TranslatedString|undefined} value  */
+proto.transit_realtime.Alert.prototype.setHeaderText = function(value) {
+  jspb.Message.setWrapperField(this, 10, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearHeaderText = function() {
+  this.setHeaderText(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasHeaderText = function() {
+  return jspb.Message.getField(this, 10) != null;
+};
+
+
+/**
+ * optional TranslatedString description_text = 11;
+ * @return {proto.transit_realtime.TranslatedString}
+ */
+proto.transit_realtime.Alert.prototype.getDescriptionText = function() {
+  return /** @type{proto.transit_realtime.TranslatedString} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TranslatedString, 11));
+};
+
+
+/** @param {proto.transit_realtime.TranslatedString|undefined} value  */
+proto.transit_realtime.Alert.prototype.setDescriptionText = function(value) {
+  jspb.Message.setWrapperField(this, 11, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearDescriptionText = function() {
+  this.setDescriptionText(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasDescriptionText = function() {
+  return jspb.Message.getField(this, 11) != null;
+};
+
+
+/**
+ * optional TranslatedString tts_header_text = 12;
+ * @return {proto.transit_realtime.TranslatedString}
+ */
+proto.transit_realtime.Alert.prototype.getTtsHeaderText = function() {
+  return /** @type{proto.transit_realtime.TranslatedString} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TranslatedString, 12));
+};
+
+
+/** @param {proto.transit_realtime.TranslatedString|undefined} value  */
+proto.transit_realtime.Alert.prototype.setTtsHeaderText = function(value) {
+  jspb.Message.setWrapperField(this, 12, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearTtsHeaderText = function() {
+  this.setTtsHeaderText(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasTtsHeaderText = function() {
+  return jspb.Message.getField(this, 12) != null;
+};
+
+
+/**
+ * optional TranslatedString tts_description_text = 13;
+ * @return {proto.transit_realtime.TranslatedString}
+ */
+proto.transit_realtime.Alert.prototype.getTtsDescriptionText = function() {
+  return /** @type{proto.transit_realtime.TranslatedString} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TranslatedString, 13));
+};
+
+
+/** @param {proto.transit_realtime.TranslatedString|undefined} value  */
+proto.transit_realtime.Alert.prototype.setTtsDescriptionText = function(value) {
+  jspb.Message.setWrapperField(this, 13, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearTtsDescriptionText = function() {
+  this.setTtsDescriptionText(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasTtsDescriptionText = function() {
+  return jspb.Message.getField(this, 13) != null;
+};
+
+
+/**
+ * optional SeverityLevel severity_level = 14;
+ * @return {proto.transit_realtime.Alert.SeverityLevel}
+ */
+proto.transit_realtime.Alert.prototype.getSeverityLevel = function() {
+  return /** @type {proto.transit_realtime.Alert.SeverityLevel} */ (!this.hasSeverityLevel() ? 1 : jspb.Message.getField(this, 14));
+};
+
+
+/** @param {proto.transit_realtime.Alert.SeverityLevel|undefined} value  */
+proto.transit_realtime.Alert.prototype.setSeverityLevel = function(value) {
+  jspb.Message.setField(this, 14, value);
+};
+
+
+proto.transit_realtime.Alert.prototype.clearSeverityLevel = function() {
+  jspb.Message.setField(this, 14, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Alert.prototype.hasSeverityLevel = function() {
+  return jspb.Message.getField(this, 14) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.Alert.extensions = {};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.Alert.Cause = {
+  UNKNOWN_CAUSE: 1,
+  OTHER_CAUSE: 2,
+  TECHNICAL_PROBLEM: 3,
+  STRIKE: 4,
+  DEMONSTRATION: 5,
+  ACCIDENT: 6,
+  HOLIDAY: 7,
+  WEATHER: 8,
+  MAINTENANCE: 9,
+  CONSTRUCTION: 10,
+  POLICE_ACTIVITY: 11,
+  MEDICAL_EMERGENCY: 12
+};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.Alert.Effect = {
+  NO_SERVICE: 1,
+  REDUCED_SERVICE: 2,
+  SIGNIFICANT_DELAYS: 3,
+  DETOUR: 4,
+  ADDITIONAL_SERVICE: 5,
+  MODIFIED_SERVICE: 6,
+  OTHER_EFFECT: 7,
+  UNKNOWN_EFFECT: 8,
+  STOP_MOVED: 9,
+  NO_EFFECT: 10,
+  ACCESSIBILITY_ISSUE: 11
+};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.Alert.SeverityLevel = {
+  UNKNOWN_SEVERITY: 1,
+  INFO: 2,
+  WARNING: 3,
+  SEVERE: 4
+};
+

+ 276 - 0
experimental/rtjs/entityselector.js

@@ -0,0 +1,276 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.EntitySelector');
+
+goog.require('jspb.Message');
+goog.require('proto.transit_realtime.TripDescriptor');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.EntitySelector = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 7, null, null);
+};
+goog.inherits(proto.transit_realtime.EntitySelector, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.EntitySelector.displayName = 'proto.transit_realtime.EntitySelector';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.EntitySelector.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.EntitySelector.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.EntitySelector} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.EntitySelector.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    agencyId: jspb.Message.getField(msg, 1),
+    routeId: jspb.Message.getField(msg, 2),
+    routeType: jspb.Message.getField(msg, 3),
+    trip: (f = msg.getTrip()) && proto.transit_realtime.TripDescriptor.toObject(includeInstance, f),
+    stopId: jspb.Message.getField(msg, 5),
+    directionId: jspb.Message.getField(msg, 6)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.EntitySelector.extensions, proto.transit_realtime.EntitySelector.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.EntitySelector} The clone.
+ */
+proto.transit_realtime.EntitySelector.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.EntitySelector} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional string agency_id = 1;
+ * @return {string}
+ */
+proto.transit_realtime.EntitySelector.prototype.getAgencyId = function() {
+  return /** @type {string} */ (!this.hasAgencyId() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.EntitySelector.prototype.setAgencyId = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.EntitySelector.prototype.clearAgencyId = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.EntitySelector.prototype.hasAgencyId = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string route_id = 2;
+ * @return {string}
+ */
+proto.transit_realtime.EntitySelector.prototype.getRouteId = function() {
+  return /** @type {string} */ (!this.hasRouteId() ? "" : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.EntitySelector.prototype.setRouteId = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.EntitySelector.prototype.clearRouteId = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.EntitySelector.prototype.hasRouteId = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional int32 route_type = 3;
+ * @return {number}
+ */
+proto.transit_realtime.EntitySelector.prototype.getRouteType = function() {
+  return /** @type {number} */ (!this.hasRouteType() ? 0 : jspb.Message.getField(this, 3));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.EntitySelector.prototype.setRouteType = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.EntitySelector.prototype.clearRouteType = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.EntitySelector.prototype.hasRouteType = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional TripDescriptor trip = 4;
+ * @return {proto.transit_realtime.TripDescriptor}
+ */
+proto.transit_realtime.EntitySelector.prototype.getTrip = function() {
+  return /** @type{proto.transit_realtime.TripDescriptor} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TripDescriptor, 4));
+};
+
+
+/** @param {proto.transit_realtime.TripDescriptor|undefined} value  */
+proto.transit_realtime.EntitySelector.prototype.setTrip = function(value) {
+  jspb.Message.setWrapperField(this, 4, value);
+};
+
+
+proto.transit_realtime.EntitySelector.prototype.clearTrip = function() {
+  this.setTrip(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.EntitySelector.prototype.hasTrip = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+/**
+ * optional string stop_id = 5;
+ * @return {string}
+ */
+proto.transit_realtime.EntitySelector.prototype.getStopId = function() {
+  return /** @type {string} */ (!this.hasStopId() ? "" : jspb.Message.getField(this, 5));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.EntitySelector.prototype.setStopId = function(value) {
+  jspb.Message.setField(this, 5, value);
+};
+
+
+proto.transit_realtime.EntitySelector.prototype.clearStopId = function() {
+  jspb.Message.setField(this, 5, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.EntitySelector.prototype.hasStopId = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+/**
+ * optional uint32 direction_id = 6;
+ * @return {number}
+ */
+proto.transit_realtime.EntitySelector.prototype.getDirectionId = function() {
+  return /** @type {number} */ (!this.hasDirectionId() ? 0 : jspb.Message.getField(this, 6));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.EntitySelector.prototype.setDirectionId = function(value) {
+  jspb.Message.setField(this, 6, value);
+};
+
+
+proto.transit_realtime.EntitySelector.prototype.clearDirectionId = function() {
+  jspb.Message.setField(this, 6, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.EntitySelector.prototype.hasDirectionId = function() {
+  return jspb.Message.getField(this, 6) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.EntitySelector.extensions = {};
+

+ 284 - 0
experimental/rtjs/feedentity.js

@@ -0,0 +1,284 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.FeedEntity');
+
+goog.require('jspb.Message');
+goog.require('proto.transit_realtime.Alert');
+goog.require('proto.transit_realtime.Shape');
+goog.require('proto.transit_realtime.TripUpdate');
+goog.require('proto.transit_realtime.VehiclePosition');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.FeedEntity = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 7, null, null);
+};
+goog.inherits(proto.transit_realtime.FeedEntity, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.FeedEntity.displayName = 'proto.transit_realtime.FeedEntity';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.FeedEntity.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.FeedEntity.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.FeedEntity} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.FeedEntity.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    id: jspb.Message.getField(msg, 1),
+    isDeleted: !msg.hasIsDeleted() ? false : jspb.Message.getField(msg, 2),
+    tripUpdate: (f = msg.getTripUpdate()) && proto.transit_realtime.TripUpdate.toObject(includeInstance, f),
+    vehicle: (f = msg.getVehicle()) && proto.transit_realtime.VehiclePosition.toObject(includeInstance, f),
+    alert: (f = msg.getAlert()) && proto.transit_realtime.Alert.toObject(includeInstance, f),
+    shape: (f = msg.getShape()) && proto.transit_realtime.Shape.toObject(includeInstance, f)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.FeedEntity.extensions, proto.transit_realtime.FeedEntity.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.FeedEntity} The clone.
+ */
+proto.transit_realtime.FeedEntity.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.FeedEntity} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * required string id = 1;
+ * @return {string}
+ */
+proto.transit_realtime.FeedEntity.prototype.getId = function() {
+  return /** @type {string} */ (!this.hasId() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string|undefined} value  */
+proto.transit_realtime.FeedEntity.prototype.setId = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.FeedEntity.prototype.clearId = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.hasId = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional bool is_deleted = 2;
+ * Note that Boolean fields may be set to 0/1 when serialized from a Java server.
+ * You should avoid comparisons like {@code val === true/false} in those cases.
+ * @return {boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.getIsDeleted = function() {
+  return /** @type {boolean} */ (!this.hasIsDeleted() ? false : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {boolean?|undefined} value  */
+proto.transit_realtime.FeedEntity.prototype.setIsDeleted = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.FeedEntity.prototype.clearIsDeleted = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.hasIsDeleted = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional TripUpdate trip_update = 3;
+ * @return {proto.transit_realtime.TripUpdate}
+ */
+proto.transit_realtime.FeedEntity.prototype.getTripUpdate = function() {
+  return /** @type{proto.transit_realtime.TripUpdate} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TripUpdate, 3));
+};
+
+
+/** @param {proto.transit_realtime.TripUpdate|undefined} value  */
+proto.transit_realtime.FeedEntity.prototype.setTripUpdate = function(value) {
+  jspb.Message.setWrapperField(this, 3, value);
+};
+
+
+proto.transit_realtime.FeedEntity.prototype.clearTripUpdate = function() {
+  this.setTripUpdate(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.hasTripUpdate = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional VehiclePosition vehicle = 4;
+ * @return {proto.transit_realtime.VehiclePosition}
+ */
+proto.transit_realtime.FeedEntity.prototype.getVehicle = function() {
+  return /** @type{proto.transit_realtime.VehiclePosition} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.VehiclePosition, 4));
+};
+
+
+/** @param {proto.transit_realtime.VehiclePosition|undefined} value  */
+proto.transit_realtime.FeedEntity.prototype.setVehicle = function(value) {
+  jspb.Message.setWrapperField(this, 4, value);
+};
+
+
+proto.transit_realtime.FeedEntity.prototype.clearVehicle = function() {
+  this.setVehicle(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.hasVehicle = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+/**
+ * optional Alert alert = 5;
+ * @return {proto.transit_realtime.Alert}
+ */
+proto.transit_realtime.FeedEntity.prototype.getAlert = function() {
+  return /** @type{proto.transit_realtime.Alert} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.Alert, 5));
+};
+
+
+/** @param {proto.transit_realtime.Alert|undefined} value  */
+proto.transit_realtime.FeedEntity.prototype.setAlert = function(value) {
+  jspb.Message.setWrapperField(this, 5, value);
+};
+
+
+proto.transit_realtime.FeedEntity.prototype.clearAlert = function() {
+  this.setAlert(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.hasAlert = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+/**
+ * optional Shape shape = 6;
+ * @return {proto.transit_realtime.Shape}
+ */
+proto.transit_realtime.FeedEntity.prototype.getShape = function() {
+  return /** @type{proto.transit_realtime.Shape} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.Shape, 6));
+};
+
+
+/** @param {proto.transit_realtime.Shape|undefined} value  */
+proto.transit_realtime.FeedEntity.prototype.setShape = function(value) {
+  jspb.Message.setWrapperField(this, 6, value);
+};
+
+
+proto.transit_realtime.FeedEntity.prototype.clearShape = function() {
+  this.setShape(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedEntity.prototype.hasShape = function() {
+  return jspb.Message.getField(this, 6) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.FeedEntity.extensions = {};
+

+ 193 - 0
experimental/rtjs/feedheader.js

@@ -0,0 +1,193 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.FeedHeader');
+goog.provide('proto.transit_realtime.FeedHeader.Incrementality');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.FeedHeader = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 4, null, null);
+};
+goog.inherits(proto.transit_realtime.FeedHeader, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.FeedHeader.displayName = 'proto.transit_realtime.FeedHeader';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.FeedHeader.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.FeedHeader.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.FeedHeader} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.FeedHeader.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    gtfsRealtimeVersion: jspb.Message.getField(msg, 1),
+    incrementality: !msg.hasIncrementality() ? 0 : jspb.Message.getField(msg, 2),
+    timestamp: jspb.Message.getField(msg, 3)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.FeedHeader.extensions, proto.transit_realtime.FeedHeader.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.FeedHeader} The clone.
+ */
+proto.transit_realtime.FeedHeader.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.FeedHeader} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * required string gtfs_realtime_version = 1;
+ * @return {string}
+ */
+proto.transit_realtime.FeedHeader.prototype.getGtfsRealtimeVersion = function() {
+  return /** @type {string} */ (!this.hasGtfsRealtimeVersion() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string|undefined} value  */
+proto.transit_realtime.FeedHeader.prototype.setGtfsRealtimeVersion = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.FeedHeader.prototype.clearGtfsRealtimeVersion = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedHeader.prototype.hasGtfsRealtimeVersion = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional Incrementality incrementality = 2;
+ * @return {proto.transit_realtime.FeedHeader.Incrementality}
+ */
+proto.transit_realtime.FeedHeader.prototype.getIncrementality = function() {
+  return /** @type {proto.transit_realtime.FeedHeader.Incrementality} */ (!this.hasIncrementality() ? 0 : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {proto.transit_realtime.FeedHeader.Incrementality|undefined} value  */
+proto.transit_realtime.FeedHeader.prototype.setIncrementality = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.FeedHeader.prototype.clearIncrementality = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedHeader.prototype.hasIncrementality = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional uint64 timestamp = 3;
+ * @return {number}
+ */
+proto.transit_realtime.FeedHeader.prototype.getTimestamp = function() {
+  return /** @type {number} */ (!this.hasTimestamp() ? 0 : jspb.Message.getField(this, 3));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.FeedHeader.prototype.setTimestamp = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.FeedHeader.prototype.clearTimestamp = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedHeader.prototype.hasTimestamp = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.FeedHeader.extensions = {};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.FeedHeader.Incrementality = {
+  FULL_DATASET: 0,
+  DIFFERENTIAL: 1
+};
+

+ 159 - 0
experimental/rtjs/feedmessage.js

@@ -0,0 +1,159 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.FeedMessage');
+
+goog.require('jspb.Message');
+goog.require('proto.transit_realtime.FeedEntity');
+goog.require('proto.transit_realtime.FeedHeader');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.FeedMessage = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 3, proto.transit_realtime.FeedMessage.repeatedFields_, null);
+};
+goog.inherits(proto.transit_realtime.FeedMessage, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.FeedMessage.displayName = 'proto.transit_realtime.FeedMessage';
+}
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array<number>}
+ * @const
+ */
+proto.transit_realtime.FeedMessage.repeatedFields_ = [2];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.FeedMessage.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.FeedMessage.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.FeedMessage} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.FeedMessage.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    header: (f = msg.getHeader()) && proto.transit_realtime.FeedHeader.toObject(includeInstance, f),
+    entityList: jspb.Message.toObjectList(msg.getEntityList(),
+    proto.transit_realtime.FeedEntity.toObject, includeInstance)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.FeedMessage.extensions, proto.transit_realtime.FeedMessage.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.FeedMessage} The clone.
+ */
+proto.transit_realtime.FeedMessage.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.FeedMessage} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * required FeedHeader header = 1;
+ * @return {!proto.transit_realtime.FeedHeader}
+ */
+proto.transit_realtime.FeedMessage.prototype.getHeader = function() {
+  return /** @type{!proto.transit_realtime.FeedHeader} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.FeedHeader, 1, 1));
+};
+
+
+/** @param {proto.transit_realtime.FeedHeader|undefined} value  */
+proto.transit_realtime.FeedMessage.prototype.setHeader = function(value) {
+  jspb.Message.setWrapperField(this, 1, value);
+};
+
+
+proto.transit_realtime.FeedMessage.prototype.clearHeader = function() {
+  this.setHeader(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.FeedMessage.prototype.hasHeader = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * repeated FeedEntity entity = 2;
+ * If you change this array by adding, removing or replacing elements, or if you
+ * replace the array itself, then you must call the setter to update it.
+ * @return {!Array.<!proto.transit_realtime.FeedEntity>}
+ */
+proto.transit_realtime.FeedMessage.prototype.getEntityList = function() {
+  return /** @type{!Array.<!proto.transit_realtime.FeedEntity>} */ (
+    jspb.Message.getRepeatedWrapperField(this, proto.transit_realtime.FeedEntity, 2));
+};
+
+
+/** @param {Array.<!proto.transit_realtime.FeedEntity>} value  */
+proto.transit_realtime.FeedMessage.prototype.setEntityList = function(value) {
+  jspb.Message.setRepeatedWrapperField(this, 2, value);
+};
+
+
+proto.transit_realtime.FeedMessage.prototype.clearEntityList = function() {
+  this.setEntityList([]);
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.FeedMessage.extensions = {};
+

+ 1 - 0
experimental/rtjs/pb2json.js

@@ -0,0 +1 @@
+var vp = require("./rtjs/vehicleposition.js");

+ 244 - 0
experimental/rtjs/position.js

@@ -0,0 +1,244 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.Position');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.Position = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 6, null, null);
+};
+goog.inherits(proto.transit_realtime.Position, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.Position.displayName = 'proto.transit_realtime.Position';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.Position.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.Position.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.Position} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.Position.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    latitude: +jspb.Message.getField(msg, 1),
+    longitude: +jspb.Message.getField(msg, 2),
+    bearing: jspb.Message.getOptionalFloatingPointField(msg, 3),
+    odometer: jspb.Message.getOptionalFloatingPointField(msg, 4),
+    speed: jspb.Message.getOptionalFloatingPointField(msg, 5)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.Position.extensions, proto.transit_realtime.Position.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.Position} The clone.
+ */
+proto.transit_realtime.Position.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.Position} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * required float latitude = 1;
+ * @return {number}
+ */
+proto.transit_realtime.Position.prototype.getLatitude = function() {
+  return /** @type {number} */ (!this.hasLatitude() ? 0.0 : +jspb.Message.getField(this, 1));
+};
+
+
+/** @param {number|undefined} value  */
+proto.transit_realtime.Position.prototype.setLatitude = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.Position.prototype.clearLatitude = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Position.prototype.hasLatitude = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * required float longitude = 2;
+ * @return {number}
+ */
+proto.transit_realtime.Position.prototype.getLongitude = function() {
+  return /** @type {number} */ (!this.hasLongitude() ? 0.0 : +jspb.Message.getField(this, 2));
+};
+
+
+/** @param {number|undefined} value  */
+proto.transit_realtime.Position.prototype.setLongitude = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.Position.prototype.clearLongitude = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Position.prototype.hasLongitude = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional float bearing = 3;
+ * @return {number}
+ */
+proto.transit_realtime.Position.prototype.getBearing = function() {
+  return /** @type {number} */ (!this.hasBearing() ? 0.0 : +jspb.Message.getField(this, 3));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.Position.prototype.setBearing = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.Position.prototype.clearBearing = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Position.prototype.hasBearing = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional double odometer = 4;
+ * @return {number}
+ */
+proto.transit_realtime.Position.prototype.getOdometer = function() {
+  return /** @type {number} */ (!this.hasOdometer() ? 0.0 : +jspb.Message.getField(this, 4));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.Position.prototype.setOdometer = function(value) {
+  jspb.Message.setField(this, 4, value);
+};
+
+
+proto.transit_realtime.Position.prototype.clearOdometer = function() {
+  jspb.Message.setField(this, 4, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Position.prototype.hasOdometer = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+/**
+ * optional float speed = 5;
+ * @return {number}
+ */
+proto.transit_realtime.Position.prototype.getSpeed = function() {
+  return /** @type {number} */ (!this.hasSpeed() ? 0.0 : +jspb.Message.getField(this, 5));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.Position.prototype.setSpeed = function(value) {
+  jspb.Message.setField(this, 5, value);
+};
+
+
+proto.transit_realtime.Position.prototype.clearSpeed = function() {
+  jspb.Message.setField(this, 5, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Position.prototype.hasSpeed = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.Position.extensions = {};
+

+ 154 - 0
experimental/rtjs/shape.js

@@ -0,0 +1,154 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.Shape');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.Shape = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 3, null, null);
+};
+goog.inherits(proto.transit_realtime.Shape, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.Shape.displayName = 'proto.transit_realtime.Shape';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.Shape.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.Shape.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.Shape} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.Shape.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    shapeId: jspb.Message.getField(msg, 1),
+    encodedPolyline: jspb.Message.getField(msg, 2)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.Shape.extensions, proto.transit_realtime.Shape.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.Shape} The clone.
+ */
+proto.transit_realtime.Shape.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.Shape} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional string shape_id = 1;
+ * @return {string}
+ */
+proto.transit_realtime.Shape.prototype.getShapeId = function() {
+  return /** @type {string} */ (!this.hasShapeId() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.Shape.prototype.setShapeId = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.Shape.prototype.clearShapeId = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Shape.prototype.hasShapeId = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string encoded_polyline = 2;
+ * @return {string}
+ */
+proto.transit_realtime.Shape.prototype.getEncodedPolyline = function() {
+  return /** @type {string} */ (!this.hasEncodedPolyline() ? "" : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.Shape.prototype.setEncodedPolyline = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.Shape.prototype.clearEncodedPolyline = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.Shape.prototype.hasEncodedPolyline = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.Shape.extensions = {};
+

+ 154 - 0
experimental/rtjs/timerange.js

@@ -0,0 +1,154 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.TimeRange');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.TimeRange = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 3, null, null);
+};
+goog.inherits(proto.transit_realtime.TimeRange, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.TimeRange.displayName = 'proto.transit_realtime.TimeRange';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.TimeRange.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.TimeRange.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.TimeRange} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.TimeRange.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    start: jspb.Message.getField(msg, 1),
+    end: jspb.Message.getField(msg, 2)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.TimeRange.extensions, proto.transit_realtime.TimeRange.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.TimeRange} The clone.
+ */
+proto.transit_realtime.TimeRange.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.TimeRange} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional uint64 start = 1;
+ * @return {number}
+ */
+proto.transit_realtime.TimeRange.prototype.getStart = function() {
+  return /** @type {number} */ (!this.hasStart() ? 0 : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.TimeRange.prototype.setStart = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.TimeRange.prototype.clearStart = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TimeRange.prototype.hasStart = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional uint64 end = 2;
+ * @return {number}
+ */
+proto.transit_realtime.TimeRange.prototype.getEnd = function() {
+  return /** @type {number} */ (!this.hasEnd() ? 0 : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.TimeRange.prototype.setEnd = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.TimeRange.prototype.clearEnd = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TimeRange.prototype.hasEnd = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.TimeRange.extensions = {};
+

+ 270 - 0
experimental/rtjs/translatedstring.js

@@ -0,0 +1,270 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.TranslatedString');
+goog.provide('proto.transit_realtime.TranslatedString.Translation');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.TranslatedString = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 2, proto.transit_realtime.TranslatedString.repeatedFields_, null);
+};
+goog.inherits(proto.transit_realtime.TranslatedString, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.TranslatedString.displayName = 'proto.transit_realtime.TranslatedString';
+}
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array<number>}
+ * @const
+ */
+proto.transit_realtime.TranslatedString.repeatedFields_ = [1];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.TranslatedString.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.TranslatedString.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.TranslatedString} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.TranslatedString.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    translationList: jspb.Message.toObjectList(msg.getTranslationList(),
+    proto.transit_realtime.TranslatedString.Translation.toObject, includeInstance)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.TranslatedString.extensions, proto.transit_realtime.TranslatedString.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.TranslatedString} The clone.
+ */
+proto.transit_realtime.TranslatedString.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.TranslatedString} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * repeated Translation translation = 1;
+ * If you change this array by adding, removing or replacing elements, or if you
+ * replace the array itself, then you must call the setter to update it.
+ * @return {!Array.<!proto.transit_realtime.TranslatedString.Translation>}
+ */
+proto.transit_realtime.TranslatedString.prototype.getTranslationList = function() {
+  return /** @type{!Array.<!proto.transit_realtime.TranslatedString.Translation>} */ (
+    jspb.Message.getRepeatedWrapperField(this, proto.transit_realtime.TranslatedString.Translation, 1));
+};
+
+
+/** @param {Array.<!proto.transit_realtime.TranslatedString.Translation>} value  */
+proto.transit_realtime.TranslatedString.prototype.setTranslationList = function(value) {
+  jspb.Message.setRepeatedWrapperField(this, 1, value);
+};
+
+
+proto.transit_realtime.TranslatedString.prototype.clearTranslationList = function() {
+  this.setTranslationList([]);
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.TranslatedString.extensions = {};
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.TranslatedString.Translation = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 3, null, null);
+};
+goog.inherits(proto.transit_realtime.TranslatedString.Translation, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.TranslatedString.Translation.displayName = 'proto.transit_realtime.TranslatedString.Translation';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.TranslatedString.Translation.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.TranslatedString.Translation.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.TranslatedString.Translation} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.TranslatedString.Translation.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    text: jspb.Message.getField(msg, 1),
+    language: jspb.Message.getField(msg, 2)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.TranslatedString.Translation.extensions, proto.transit_realtime.TranslatedString.Translation.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.TranslatedString.Translation} The clone.
+ */
+proto.transit_realtime.TranslatedString.Translation.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.TranslatedString.Translation} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * required string text = 1;
+ * @return {string}
+ */
+proto.transit_realtime.TranslatedString.Translation.prototype.getText = function() {
+  return /** @type {string} */ (!this.hasText() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string|undefined} value  */
+proto.transit_realtime.TranslatedString.Translation.prototype.setText = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.TranslatedString.Translation.prototype.clearText = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TranslatedString.Translation.prototype.hasText = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string language = 2;
+ * @return {string}
+ */
+proto.transit_realtime.TranslatedString.Translation.prototype.getLanguage = function() {
+  return /** @type {string} */ (!this.hasLanguage() ? "" : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.TranslatedString.Translation.prototype.setLanguage = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.TranslatedString.Translation.prototype.clearLanguage = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TranslatedString.Translation.prototype.hasLanguage = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.TranslatedString.Translation.extensions = {};
+

+ 287 - 0
experimental/rtjs/tripdescriptor.js

@@ -0,0 +1,287 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.TripDescriptor');
+goog.provide('proto.transit_realtime.TripDescriptor.ScheduleRelationship');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.TripDescriptor = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 7, null, null);
+};
+goog.inherits(proto.transit_realtime.TripDescriptor, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.TripDescriptor.displayName = 'proto.transit_realtime.TripDescriptor';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.TripDescriptor.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.TripDescriptor.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.TripDescriptor} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.TripDescriptor.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    tripId: jspb.Message.getField(msg, 1),
+    routeId: jspb.Message.getField(msg, 5),
+    directionId: jspb.Message.getField(msg, 6),
+    startTime: jspb.Message.getField(msg, 2),
+    startDate: jspb.Message.getField(msg, 3),
+    scheduleRelationship: jspb.Message.getField(msg, 4)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.TripDescriptor.extensions, proto.transit_realtime.TripDescriptor.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.TripDescriptor} The clone.
+ */
+proto.transit_realtime.TripDescriptor.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.TripDescriptor} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional string trip_id = 1;
+ * @return {string}
+ */
+proto.transit_realtime.TripDescriptor.prototype.getTripId = function() {
+  return /** @type {string} */ (!this.hasTripId() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.TripDescriptor.prototype.setTripId = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.TripDescriptor.prototype.clearTripId = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TripDescriptor.prototype.hasTripId = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string route_id = 5;
+ * @return {string}
+ */
+proto.transit_realtime.TripDescriptor.prototype.getRouteId = function() {
+  return /** @type {string} */ (!this.hasRouteId() ? "" : jspb.Message.getField(this, 5));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.TripDescriptor.prototype.setRouteId = function(value) {
+  jspb.Message.setField(this, 5, value);
+};
+
+
+proto.transit_realtime.TripDescriptor.prototype.clearRouteId = function() {
+  jspb.Message.setField(this, 5, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TripDescriptor.prototype.hasRouteId = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+/**
+ * optional uint32 direction_id = 6;
+ * @return {number}
+ */
+proto.transit_realtime.TripDescriptor.prototype.getDirectionId = function() {
+  return /** @type {number} */ (!this.hasDirectionId() ? 0 : jspb.Message.getField(this, 6));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.TripDescriptor.prototype.setDirectionId = function(value) {
+  jspb.Message.setField(this, 6, value);
+};
+
+
+proto.transit_realtime.TripDescriptor.prototype.clearDirectionId = function() {
+  jspb.Message.setField(this, 6, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TripDescriptor.prototype.hasDirectionId = function() {
+  return jspb.Message.getField(this, 6) != null;
+};
+
+
+/**
+ * optional string start_time = 2;
+ * @return {string}
+ */
+proto.transit_realtime.TripDescriptor.prototype.getStartTime = function() {
+  return /** @type {string} */ (!this.hasStartTime() ? "" : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.TripDescriptor.prototype.setStartTime = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.TripDescriptor.prototype.clearStartTime = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TripDescriptor.prototype.hasStartTime = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional string start_date = 3;
+ * @return {string}
+ */
+proto.transit_realtime.TripDescriptor.prototype.getStartDate = function() {
+  return /** @type {string} */ (!this.hasStartDate() ? "" : jspb.Message.getField(this, 3));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.TripDescriptor.prototype.setStartDate = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.TripDescriptor.prototype.clearStartDate = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TripDescriptor.prototype.hasStartDate = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional ScheduleRelationship schedule_relationship = 4;
+ * @return {proto.transit_realtime.TripDescriptor.ScheduleRelationship}
+ */
+proto.transit_realtime.TripDescriptor.prototype.getScheduleRelationship = function() {
+  return /** @type {proto.transit_realtime.TripDescriptor.ScheduleRelationship} */ (!this.hasScheduleRelationship() ? 0 : jspb.Message.getField(this, 4));
+};
+
+
+/** @param {proto.transit_realtime.TripDescriptor.ScheduleRelationship|undefined} value  */
+proto.transit_realtime.TripDescriptor.prototype.setScheduleRelationship = function(value) {
+  jspb.Message.setField(this, 4, value);
+};
+
+
+proto.transit_realtime.TripDescriptor.prototype.clearScheduleRelationship = function() {
+  jspb.Message.setField(this, 4, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.TripDescriptor.prototype.hasScheduleRelationship = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.TripDescriptor.extensions = {};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.TripDescriptor.ScheduleRelationship = {
+  SCHEDULED: 0,
+  ADDED: 1,
+  UNSCHEDULED: 2,
+  CANCELED: 3,
+  REPLACEMENT: 5,
+  DUPLICATED: 6
+};
+

File diff suppressed because it is too large
+ 1082 - 0
experimental/rtjs/tripupdate.js


+ 184 - 0
experimental/rtjs/vehicledescriptor.js

@@ -0,0 +1,184 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.VehicleDescriptor');
+
+goog.require('jspb.Message');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.VehicleDescriptor = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 4, null, null);
+};
+goog.inherits(proto.transit_realtime.VehicleDescriptor, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.VehicleDescriptor.displayName = 'proto.transit_realtime.VehicleDescriptor';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.VehicleDescriptor.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.VehicleDescriptor} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.VehicleDescriptor.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    id: jspb.Message.getField(msg, 1),
+    label: jspb.Message.getField(msg, 2),
+    licensePlate: jspb.Message.getField(msg, 3)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.VehicleDescriptor.extensions, proto.transit_realtime.VehicleDescriptor.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.VehicleDescriptor} The clone.
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.VehicleDescriptor} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional string id = 1;
+ * @return {string}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.getId = function() {
+  return /** @type {string} */ (!this.hasId() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.VehicleDescriptor.prototype.setId = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.VehicleDescriptor.prototype.clearId = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.hasId = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string label = 2;
+ * @return {string}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.getLabel = function() {
+  return /** @type {string} */ (!this.hasLabel() ? "" : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.VehicleDescriptor.prototype.setLabel = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.VehicleDescriptor.prototype.clearLabel = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.hasLabel = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional string license_plate = 3;
+ * @return {string}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.getLicensePlate = function() {
+  return /** @type {string} */ (!this.hasLicensePlate() ? "" : jspb.Message.getField(this, 3));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.VehicleDescriptor.prototype.setLicensePlate = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.VehicleDescriptor.prototype.clearLicensePlate = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehicleDescriptor.prototype.hasLicensePlate = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.VehicleDescriptor.extensions = {};
+

+ 704 - 0
experimental/rtjs/vehicleposition.js

@@ -0,0 +1,704 @@
+/**
+ * @fileoverview
+ * @enhanceable
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+goog.provide('proto.transit_realtime.VehiclePosition');
+goog.provide('proto.transit_realtime.VehiclePosition.CarriageDetails');
+goog.provide('proto.transit_realtime.VehiclePosition.CongestionLevel');
+goog.provide('proto.transit_realtime.VehiclePosition.OccupancyStatus');
+goog.provide('proto.transit_realtime.VehiclePosition.VehicleStopStatus');
+
+goog.require('jspb.Message');
+goog.require('proto.transit_realtime.Position');
+goog.require('proto.transit_realtime.TripDescriptor');
+goog.require('proto.transit_realtime.VehicleDescriptor');
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.VehiclePosition = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 12, proto.transit_realtime.VehiclePosition.repeatedFields_, null);
+};
+goog.inherits(proto.transit_realtime.VehiclePosition, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.VehiclePosition.displayName = 'proto.transit_realtime.VehiclePosition';
+}
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array<number>}
+ * @const
+ */
+proto.transit_realtime.VehiclePosition.repeatedFields_ = [11];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.VehiclePosition.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.VehiclePosition.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.VehiclePosition} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.VehiclePosition.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    trip: (f = msg.getTrip()) && proto.transit_realtime.TripDescriptor.toObject(includeInstance, f),
+    vehicle: (f = msg.getVehicle()) && proto.transit_realtime.VehicleDescriptor.toObject(includeInstance, f),
+    position: (f = msg.getPosition()) && proto.transit_realtime.Position.toObject(includeInstance, f),
+    currentStopSequence: jspb.Message.getField(msg, 3),
+    stopId: jspb.Message.getField(msg, 7),
+    currentStatus: !msg.hasCurrentStatus() ? 2 : jspb.Message.getField(msg, 4),
+    timestamp: jspb.Message.getField(msg, 5),
+    congestionLevel: jspb.Message.getField(msg, 6),
+    occupancyStatus: jspb.Message.getField(msg, 9),
+    occupancyPercentage: jspb.Message.getField(msg, 10),
+    multiCarriageDetailsList: jspb.Message.toObjectList(msg.getMultiCarriageDetailsList(),
+    proto.transit_realtime.VehiclePosition.CarriageDetails.toObject, includeInstance)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.VehiclePosition.extensions, proto.transit_realtime.VehiclePosition.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.VehiclePosition} The clone.
+ */
+proto.transit_realtime.VehiclePosition.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.VehiclePosition} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional TripDescriptor trip = 1;
+ * @return {proto.transit_realtime.TripDescriptor}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getTrip = function() {
+  return /** @type{proto.transit_realtime.TripDescriptor} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.TripDescriptor, 1));
+};
+
+
+/** @param {proto.transit_realtime.TripDescriptor|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setTrip = function(value) {
+  jspb.Message.setWrapperField(this, 1, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearTrip = function() {
+  this.setTrip(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasTrip = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional VehicleDescriptor vehicle = 8;
+ * @return {proto.transit_realtime.VehicleDescriptor}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getVehicle = function() {
+  return /** @type{proto.transit_realtime.VehicleDescriptor} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.VehicleDescriptor, 8));
+};
+
+
+/** @param {proto.transit_realtime.VehicleDescriptor|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setVehicle = function(value) {
+  jspb.Message.setWrapperField(this, 8, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearVehicle = function() {
+  this.setVehicle(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasVehicle = function() {
+  return jspb.Message.getField(this, 8) != null;
+};
+
+
+/**
+ * optional Position position = 2;
+ * @return {proto.transit_realtime.Position}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getPosition = function() {
+  return /** @type{proto.transit_realtime.Position} */ (
+    jspb.Message.getWrapperField(this, proto.transit_realtime.Position, 2));
+};
+
+
+/** @param {proto.transit_realtime.Position|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setPosition = function(value) {
+  jspb.Message.setWrapperField(this, 2, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearPosition = function() {
+  this.setPosition(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasPosition = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional uint32 current_stop_sequence = 3;
+ * @return {number}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getCurrentStopSequence = function() {
+  return /** @type {number} */ (!this.hasCurrentStopSequence() ? 0 : jspb.Message.getField(this, 3));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setCurrentStopSequence = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearCurrentStopSequence = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasCurrentStopSequence = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional string stop_id = 7;
+ * @return {string}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getStopId = function() {
+  return /** @type {string} */ (!this.hasStopId() ? "" : jspb.Message.getField(this, 7));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setStopId = function(value) {
+  jspb.Message.setField(this, 7, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearStopId = function() {
+  jspb.Message.setField(this, 7, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasStopId = function() {
+  return jspb.Message.getField(this, 7) != null;
+};
+
+
+/**
+ * optional VehicleStopStatus current_status = 4;
+ * @return {proto.transit_realtime.VehiclePosition.VehicleStopStatus}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getCurrentStatus = function() {
+  return /** @type {proto.transit_realtime.VehiclePosition.VehicleStopStatus} */ (!this.hasCurrentStatus() ? 2 : jspb.Message.getField(this, 4));
+};
+
+
+/** @param {proto.transit_realtime.VehiclePosition.VehicleStopStatus|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setCurrentStatus = function(value) {
+  jspb.Message.setField(this, 4, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearCurrentStatus = function() {
+  jspb.Message.setField(this, 4, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasCurrentStatus = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+/**
+ * optional uint64 timestamp = 5;
+ * @return {number}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getTimestamp = function() {
+  return /** @type {number} */ (!this.hasTimestamp() ? 0 : jspb.Message.getField(this, 5));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setTimestamp = function(value) {
+  jspb.Message.setField(this, 5, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearTimestamp = function() {
+  jspb.Message.setField(this, 5, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasTimestamp = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+/**
+ * optional CongestionLevel congestion_level = 6;
+ * @return {proto.transit_realtime.VehiclePosition.CongestionLevel}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getCongestionLevel = function() {
+  return /** @type {proto.transit_realtime.VehiclePosition.CongestionLevel} */ (!this.hasCongestionLevel() ? 0 : jspb.Message.getField(this, 6));
+};
+
+
+/** @param {proto.transit_realtime.VehiclePosition.CongestionLevel|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setCongestionLevel = function(value) {
+  jspb.Message.setField(this, 6, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearCongestionLevel = function() {
+  jspb.Message.setField(this, 6, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasCongestionLevel = function() {
+  return jspb.Message.getField(this, 6) != null;
+};
+
+
+/**
+ * optional OccupancyStatus occupancy_status = 9;
+ * @return {proto.transit_realtime.VehiclePosition.OccupancyStatus}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getOccupancyStatus = function() {
+  return /** @type {proto.transit_realtime.VehiclePosition.OccupancyStatus} */ (!this.hasOccupancyStatus() ? 0 : jspb.Message.getField(this, 9));
+};
+
+
+/** @param {proto.transit_realtime.VehiclePosition.OccupancyStatus|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setOccupancyStatus = function(value) {
+  jspb.Message.setField(this, 9, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearOccupancyStatus = function() {
+  jspb.Message.setField(this, 9, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasOccupancyStatus = function() {
+  return jspb.Message.getField(this, 9) != null;
+};
+
+
+/**
+ * optional uint32 occupancy_percentage = 10;
+ * @return {number}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getOccupancyPercentage = function() {
+  return /** @type {number} */ (!this.hasOccupancyPercentage() ? 0 : jspb.Message.getField(this, 10));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.VehiclePosition.prototype.setOccupancyPercentage = function(value) {
+  jspb.Message.setField(this, 10, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearOccupancyPercentage = function() {
+  jspb.Message.setField(this, 10, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.prototype.hasOccupancyPercentage = function() {
+  return jspb.Message.getField(this, 10) != null;
+};
+
+
+/**
+ * repeated CarriageDetails multi_carriage_details = 11;
+ * If you change this array by adding, removing or replacing elements, or if you
+ * replace the array itself, then you must call the setter to update it.
+ * @return {!Array.<!proto.transit_realtime.VehiclePosition.CarriageDetails>}
+ */
+proto.transit_realtime.VehiclePosition.prototype.getMultiCarriageDetailsList = function() {
+  return /** @type{!Array.<!proto.transit_realtime.VehiclePosition.CarriageDetails>} */ (
+    jspb.Message.getRepeatedWrapperField(this, proto.transit_realtime.VehiclePosition.CarriageDetails, 11));
+};
+
+
+/** @param {Array.<!proto.transit_realtime.VehiclePosition.CarriageDetails>} value  */
+proto.transit_realtime.VehiclePosition.prototype.setMultiCarriageDetailsList = function(value) {
+  jspb.Message.setRepeatedWrapperField(this, 11, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.prototype.clearMultiCarriageDetailsList = function() {
+  this.setMultiCarriageDetailsList([]);
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.VehiclePosition.extensions = {};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.VehiclePosition.VehicleStopStatus = {
+  INCOMING_AT: 0,
+  STOPPED_AT: 1,
+  IN_TRANSIT_TO: 2
+};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.VehiclePosition.CongestionLevel = {
+  UNKNOWN_CONGESTION_LEVEL: 0,
+  RUNNING_SMOOTHLY: 1,
+  STOP_AND_GO: 2,
+  CONGESTION: 3,
+  SEVERE_CONGESTION: 4
+};
+
+/**
+ * @enum {number}
+ */
+proto.transit_realtime.VehiclePosition.OccupancyStatus = {
+  EMPTY: 0,
+  MANY_SEATS_AVAILABLE: 1,
+  FEW_SEATS_AVAILABLE: 2,
+  STANDING_ROOM_ONLY: 3,
+  CRUSHED_STANDING_ROOM_ONLY: 4,
+  FULL: 5,
+  NOT_ACCEPTING_PASSENGERS: 6,
+  NO_DATA_AVAILABLE: 7,
+  NOT_BOARDABLE: 8
+};
+
+
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, 6, null, null);
+};
+goog.inherits(proto.transit_realtime.VehiclePosition.CarriageDetails, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  proto.transit_realtime.VehiclePosition.CarriageDetails.displayName = 'proto.transit_realtime.VehiclePosition.CarriageDetails';
+}
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto suitable for use in Soy templates.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
+ * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
+ *     for transitional soy proto support: http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.toObject = function(opt_includeInstance) {
+  return proto.transit_realtime.VehiclePosition.CarriageDetails.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Whether to include the JSPB
+ *     instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.transit_realtime.VehiclePosition.CarriageDetails} msg The msg instance to transform.
+ * @return {!Object}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    id: jspb.Message.getField(msg, 1),
+    label: jspb.Message.getField(msg, 2),
+    occupancyStatus: !msg.hasOccupancyStatus() ? 7 : jspb.Message.getField(msg, 3),
+    occupancyPercentage: !msg.hasOccupancyPercentage() ? -1 : jspb.Message.getField(msg, 4),
+    carriageSequence: jspb.Message.getField(msg, 5)
+  };
+
+  jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
+      proto.transit_realtime.VehiclePosition.CarriageDetails.extensions, proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.getExtension,
+      includeInstance);
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Creates a deep clone of this proto. No data is shared with the original.
+ * @return {!proto.transit_realtime.VehiclePosition.CarriageDetails} The clone.
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.cloneMessage = function() {
+  return /** @type {!proto.transit_realtime.VehiclePosition.CarriageDetails} */ (jspb.Message.cloneMessage(this));
+};
+
+
+/**
+ * optional string id = 1;
+ * @return {string}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.getId = function() {
+  return /** @type {string} */ (!this.hasId() ? "" : jspb.Message.getField(this, 1));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.setId = function(value) {
+  jspb.Message.setField(this, 1, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.clearId = function() {
+  jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.hasId = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string label = 2;
+ * @return {string}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.getLabel = function() {
+  return /** @type {string} */ (!this.hasLabel() ? "" : jspb.Message.getField(this, 2));
+};
+
+
+/** @param {string?|undefined} value  */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.setLabel = function(value) {
+  jspb.Message.setField(this, 2, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.clearLabel = function() {
+  jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.hasLabel = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional OccupancyStatus occupancy_status = 3;
+ * @return {proto.transit_realtime.VehiclePosition.OccupancyStatus}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.getOccupancyStatus = function() {
+  return /** @type {proto.transit_realtime.VehiclePosition.OccupancyStatus} */ (!this.hasOccupancyStatus() ? 7 : jspb.Message.getField(this, 3));
+};
+
+
+/** @param {proto.transit_realtime.VehiclePosition.OccupancyStatus|undefined} value  */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.setOccupancyStatus = function(value) {
+  jspb.Message.setField(this, 3, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.clearOccupancyStatus = function() {
+  jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.hasOccupancyStatus = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional int32 occupancy_percentage = 4;
+ * @return {number}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.getOccupancyPercentage = function() {
+  return /** @type {number} */ (!this.hasOccupancyPercentage() ? -1 : jspb.Message.getField(this, 4));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.setOccupancyPercentage = function(value) {
+  jspb.Message.setField(this, 4, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.clearOccupancyPercentage = function() {
+  jspb.Message.setField(this, 4, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.hasOccupancyPercentage = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+/**
+ * optional uint32 carriage_sequence = 5;
+ * @return {number}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.getCarriageSequence = function() {
+  return /** @type {number} */ (!this.hasCarriageSequence() ? 0 : jspb.Message.getField(this, 5));
+};
+
+
+/** @param {number?|undefined} value  */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.setCarriageSequence = function(value) {
+  jspb.Message.setField(this, 5, value);
+};
+
+
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.clearCarriageSequence = function() {
+  jspb.Message.setField(this, 5, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return{!boolean}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.prototype.hasCarriageSequence = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+
+/**
+ * The extensions registered with this message class. This is a map of
+ * extension field number to fieldInfo object.
+ *
+ * For example:
+ *     { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
+ *
+ * fieldName contains the JsCompiler renamed field name property so that it
+ * works in OPTIMIZED mode.
+ *
+ * @type {!Object.<number, jspb.ExtensionFieldInfo>}
+ */
+proto.transit_realtime.VehiclePosition.CarriageDetails.extensions = {};
+

BIN
experimental/test-gtfs.pb