Train Movement: Difference between revisions

From Open Rail Data Wiki
m Updated train movement documentation
Line 1: Line 1:
== Overview ==


== Overview ==
A train movement message is sent whenever a train arrives, passes or departs a location monitored by TRUST.  It records the time at which the event happens.


The Train Movement message is used to indicate a train has passed a particular reporting point, indicated by the <code>reporting_stanox</code> field. The [[STANOX]] may represent a station or junction.
Reports may be automatically generated, or manually entered.


== Example ==
== Data structure ==


<tt>
=== Header ===


    "header":
{| class='wikitable'
    {
!Field
        msg_type:"0003",
!Description
        source_dev_id:"",
|-
        user_id:"",
|msg_type
        original_data_source:"SMART",
|Set to '0003' for a movement message
        msg_queue_timestamp:"1341391532000",
|-
        source_system_id:"TRUST"
|source_dev_id
    },
|Where the movement is manually entered, set to the ID of the device that generated the movement message
    "body":
|-
    {
|source_system_id
        event_type:"DEPARTURE",
|Set to "TRUST" for a movement message
        gbtt_timestamp:"",
|-
        original_loc_stanox:"",
|original_data_source
        planned_timestamp:"1341393780000",
|Set to "TRUST', "TRUST DA" or "SDR" for a movement message
        timetable_variation:"22",
|}
        original_loc_timestamp:"",
        current_train_id:"",
        delay_monitoring_point:"true",
        next_report_run_time:"1",
        reporting_stanox:"52701",
        actual_timestamp:"1341395100000",
        correction_ind:"false",
        event_source:"AUTOMATIC",
        train_file_address:,platform:"",
        division_code:"21",
        train_terminated:"false",
        train_id:"521N16ME04",
        offroute_ind:"false",
        variation_status:"LATE",
        train_service_code:"21939001",
        toc_id:"21",
        loc_stanox:"52701",
        auto_expected:"true",
        direction_ind:"DOWN",
        route:"1",
        planned_event_type:"DEPARTURE",
        next_report_stanox:"52226",
        line_ind:"M"
    }


</tt>
=== Body ===


== Important Fields ==
"body":{"event_type":"ARRIVAL","timetable_variation":"38","current_train_id":null,"delay_monitoring_point":"true","next_report_run_time":"","reporting_stanox":"86092","correction_ind":"false","event_source":"MANUAL","train_file_address":"IEA","platform":"","division_code":"00","train_terminated":"true","train_id":"88350DC904","offroute_ind":"false","variation_status":"EARLY","train_service_code":"53790132","toc_id":"00",,"auto_expected":"true","direction_ind":"","route":"0","next_report_stanox":"","line_ind":""}}


The fields of main significance are:


{| class="wikitable"
{| class='wikitable'
!Field
!Description
|-
|train_id
|The 10-character unique identity for this train at TRUST activation time
|-
|actual_timestamp
|The date and time that this event happened at the location
|-
|loc_stanox
|The STANOX of the location at which this event happened
|-
|gbtt_timestamp
|The planned GBTT (passenger) date and time that the event was due to happen at this location
|-
|planned_timestamp
|The planned date and time that this event was due to happen at this location
|-
|original_loc_stanox
|If the location has been revised, the STANOX of the location in the schedule at activation time
|-
|original_loc_timestamp
|The planned departure time associated with the original location
|-
|planned_event_type
|The planned type of event - one of "ARRIVAL", "DEPARTURE" or "DESTINATION"
|-
|event_type
|The type of event - either "ARRIVAL" or "DEPARTURE"
|-
|event_source
|Whether the event source was "AUTOMATIC" from SMART, or "MANUAL" from TOPS or TRUST SDR
|-
|correction_ind
|Set to "false" if this report is not a correction of a previous report, or "true" if it is
|-
|offroute_ind
|Set to "false" if this report is for a location in the schedule, or "true" if it is not
|-
|direction_ind
|For automatic reports, either "UP" or "DOWN" depending on the direction of travel
|-
|line_ind
|A single character (or blank) depending on the line the train is travelling on, e.g. F = Fast, S = Slow
|-
|platform
|Two characters (including a space for a single character) or blank if the movement report is associated with a platform number
|-
|route
|A single character (or blank) to indicate the exit route from this location
|-
|current_train_id
|Where a train has had its identity changed, the current 10-character unique identity for this train
|-
|train_service_code
|Train service code as per schedule
|-
|division_code
|Operating company ID as per [[TOC Codes]]
|-
|toc_id
|Operating company ID as per [[TOC Codes]]
|-
|timetable_variation
|The number of minutes variation from the scheduled time at this location.  Off-route reports will contain "0"
|-
|variation_status
|One of "ON TIME", "EARLY", "LATE" or "OFF ROUTE"
|-
|next_report_stanox
|The STANOX of the location at which the next report for this train is due
|-
|-
! Field !! Value !! Explanation
|next_report_run_time
|The running time to the next location
|-
|-
| event_type|| DEPARTURE|| the train has departed the STANOX reported
|train_terminated
|Set to "true" if the train has completed its journey, or "false" otherwise
|-
|-
| planned_timestamp|| 1341393780000|| The time the train should have departed the STANOX ( 09:23:00 )
|delay_monitoring_point
|Set to "true" if this is a delay monitoring point, "false" if it is not.  Off-route reports will contain "false"
|-
|-
| actual_timestamp|| 1341395100000|| The time the train actually departed the STANOX ( 09:45:00 )
|train_file_address
|The TOPS train file address, if applicable
|-
|-
| train_id|| 521N16ME04|| train header code. provides a unique identifier for this journey. Digits 3-6 indicate the route, which can be looked up in the timetable data (1N16 - In this case may have been Liverpool Street -Clacton-on-Sea )
|reporting_stanox
|The STANOX of the location that generated this report. Set to "00000" for manual and off-route reports
|-
|-
| reporting_stanox|| 52701|| The location of the train when the message occured. (Bow Junction in this case)
|auto_expected
|Set to "true" if an automatic report is expected for this location, otherwise "false"
|-
|-
| next_report_stanox|| 52226|| The next location where this train will report its location. (Stratford in this case)
|}
|}

Revision as of 10:28, 15 February 2013

Overview

A train movement message is sent whenever a train arrives, passes or departs a location monitored by TRUST. It records the time at which the event happens.

Reports may be automatically generated, or manually entered.

Data structure

Header

Field Description
msg_type Set to '0003' for a movement message
source_dev_id Where the movement is manually entered, set to the ID of the device that generated the movement message
source_system_id Set to "TRUST" for a movement message
original_data_source Set to "TRUST', "TRUST DA" or "SDR" for a movement message

Body

"body":{"event_type":"ARRIVAL","timetable_variation":"38","current_train_id":null,"delay_monitoring_point":"true","next_report_run_time":"","reporting_stanox":"86092","correction_ind":"false","event_source":"MANUAL","train_file_address":"IEA","platform":"","division_code":"00","train_terminated":"true","train_id":"88350DC904","offroute_ind":"false","variation_status":"EARLY","train_service_code":"53790132","toc_id":"00",,"auto_expected":"true","direction_ind":"","route":"0","next_report_stanox":"","line_ind":""}}


Field Description
train_id The 10-character unique identity for this train at TRUST activation time
actual_timestamp The date and time that this event happened at the location
loc_stanox The STANOX of the location at which this event happened
gbtt_timestamp The planned GBTT (passenger) date and time that the event was due to happen at this location
planned_timestamp The planned date and time that this event was due to happen at this location
original_loc_stanox If the location has been revised, the STANOX of the location in the schedule at activation time
original_loc_timestamp The planned departure time associated with the original location
planned_event_type The planned type of event - one of "ARRIVAL", "DEPARTURE" or "DESTINATION"
event_type The type of event - either "ARRIVAL" or "DEPARTURE"
event_source Whether the event source was "AUTOMATIC" from SMART, or "MANUAL" from TOPS or TRUST SDR
correction_ind Set to "false" if this report is not a correction of a previous report, or "true" if it is
offroute_ind Set to "false" if this report is for a location in the schedule, or "true" if it is not
direction_ind For automatic reports, either "UP" or "DOWN" depending on the direction of travel
line_ind A single character (or blank) depending on the line the train is travelling on, e.g. F = Fast, S = Slow
platform Two characters (including a space for a single character) or blank if the movement report is associated with a platform number
route A single character (or blank) to indicate the exit route from this location
current_train_id Where a train has had its identity changed, the current 10-character unique identity for this train
train_service_code Train service code as per schedule
division_code Operating company ID as per TOC Codes
toc_id Operating company ID as per TOC Codes
timetable_variation The number of minutes variation from the scheduled time at this location. Off-route reports will contain "0"
variation_status One of "ON TIME", "EARLY", "LATE" or "OFF ROUTE"
next_report_stanox The STANOX of the location at which the next report for this train is due
next_report_run_time The running time to the next location
train_terminated Set to "true" if the train has completed its journey, or "false" otherwise
delay_monitoring_point Set to "true" if this is a delay monitoring point, "false" if it is not. Off-route reports will contain "false"
train_file_address The TOPS train file address, if applicable
reporting_stanox The STANOX of the location that generated this report. Set to "00000" for manual and off-route reports
auto_expected Set to "true" if an automatic report is expected for this location, otherwise "false"