gtrain

source code for my gtrain tracker project
git clone git://git.alexwennerberg.com/gtrain
Log | Files | Refs | README | LICENSE

nyct-subway.proto (5439B) - raw


      1 //
      2 // NYCT Subway extensions for the GTFS-realtime protocol.
      3 // From https://api.mta.info/nyct-subway.proto.txt
      4 //
      5 option java_package = "com.google.transit.realtime"; 
      6 
      7 import "gtfs-realtime.proto";
      8   
      9 message TripReplacementPeriod {
     10   // The replacement period is for this route
     11   optional string route_id = 1;
     12   // The start time is omitted, the end time is currently now + 30 minutes for
     13   // all routes of the A division
     14   optional transit_realtime.TimeRange replacement_period = 2;
     15 }
     16 
     17 // NYCT Subway extensions for the feed header
     18 message NyctFeedHeader {
     19   // Version of the NYCT Subway extensions
     20   // The current version is 1.0
     21   required string nyct_subway_version = 1;
     22   // For the NYCT Subway, the GTFS-realtime feed replaces any scheduled
     23   // trip within the trip_replacement_period. 
     24   // This feed is a full dataset, it contains all trips starting 
     25   // in the trip_replacement_period. If a trip from the static GTFS is not
     26   // found in the GTFS-realtime feed, it should be considered as cancelled.
     27   // The replacement period can be different for each route, so here is 
     28   // a list of the routes where the trips in the feed replace all 
     29   // scheduled trips within the replacement period.
     30   repeated TripReplacementPeriod trip_replacement_period = 2;
     31 }
     32 
     33 extend transit_realtime.FeedHeader {
     34  optional NyctFeedHeader nyct_feed_header = 1001;
     35 }
     36 
     37 // NYCT Subway extensions for the trip descriptor
     38 message NyctTripDescriptor {
     39   // The nyct_train_id is meant for internal use only. It provides an
     40   // easy way to associated GTFS-realtime trip identifiers with NYCT rail
     41   // operations identifier 
     42   // 
     43   // The ATS office system assigns unique train identification (Train ID) to
     44   // each train operating within or ready to enter the mainline of the
     45   // monitored territory. An example of this is 06 0123+ PEL/BBR and is decoded
     46   // as follows: 
     47   // 
     48   // The first character represents the trip type designator. 0 identifies a
     49   // scheduled revenue trip. Other revenue trip values that are a result of a
     50   // change to the base schedule include; [= reroute], [/ skip stop], [$ turn
     51   // train] also known as shortly lined service.  
     52   // 
     53   // The second character 6 represents the trip line i.e. number 6 train The
     54   // third set of characters identify the decoded origin time. The last
     55   // character may be blank "on the whole minute" or + "30 seconds" 
     56   // 
     57   // Note: Origin times will not change when there is a trip type change.  This
     58   // is followed by a three character "Origin Location" / "Destination
     59   // Location"
     60   optional string train_id = 1;
     61 
     62   // This trip has been assigned to a physical train. If true, this trip is
     63   // already underway or most likely will depart shortly. 
     64   //
     65   // Train Assignment is a function of the Automatic Train Supervision (ATS)
     66   // office system used by NYCT Rail Operations to monitor and track train
     67   // movements. ATS provides the ability to "assign" the nyct_train_id
     68   // attribute when a physical train is at its origin terminal. These assigned
     69   // trips have the is_assigned field set in the TripDescriptor.
     70   //
     71   // When a train is at a terminal but has not been given a work program it is
     72   // declared unassigned and is tagged as such. Unassigned trains can be moved
     73   // to a storage location or assigned a nyct_train_id when a determination for
     74   // service is made.
     75   optional bool is_assigned = 2; 
     76 
     77   // The direction the train is moving. 
     78   enum Direction {
     79     NORTH = 1;
     80     EAST = 2;
     81     SOUTH = 3;
     82     WEST = 4; 
     83   }
     84   // Uptown and Bronx-bound trains are moving NORTH.
     85   // Times Square Shuttle to Grand Central is also northbound.
     86   //
     87   // Downtown and Brooklyn-bound trains are moving SOUTH.
     88   // Times Square Shuttle to Times Square is also southbound.
     89   // 
     90   // EAST and WEST are not used currently.
     91   optional Direction direction = 3;
     92 }
     93 
     94 extend transit_realtime.TripDescriptor {
     95   optional NyctTripDescriptor nyct_trip_descriptor = 1001;
     96 }
     97 
     98 // NYCT Subway extensions for the stop time update
     99 message NyctStopTimeUpdate {
    100   // Provides the planned station arrival track. The following is the Manhattan
    101   // track configurations:
    102   // 1: southbound local
    103   // 2: southbound express
    104   // 3: northbound express
    105   // 4: northbound local
    106   //
    107   // In the Bronx (except Dyre Ave line)
    108   // M: bi-directional express (in the AM express to Manhattan, in the PM
    109   // express away).
    110   //
    111   // The Dyre Ave line is configured:
    112   // 1: southbound
    113   // 2: northbound
    114   // 3: bi-directional
    115   optional string scheduled_track = 1;
    116 
    117   // This is the actual track that the train is operating on and can be used to
    118   // determine if a train is operating according to its current schedule
    119   // (plan).
    120   // 
    121   // The actual track is known only shortly before the train reaches a station,
    122   // typically not before it leaves the previous station. Therefore, the NYCT
    123   // feed sets this field only for the first station of the remaining trip.
    124   // 
    125   // Different actual and scheduled track is the result of manually rerouting a
    126   // train off it scheduled path.  When this occurs, prediction data may become
    127   // unreliable since the train is no longer operating in accordance to its
    128   // schedule.  The rules engine for the 'countdown' clocks will remove this
    129   // train from all schedule stations.
    130   optional string actual_track = 2;
    131 }
    132 
    133 extend transit_realtime.TripUpdate.StopTimeUpdate {
    134   optional NyctStopTimeUpdate nyct_stop_time_update = 1001;
    135 }