Train Movement: Difference between revisions

From Open Rail Data Wiki
m Updated train movement documentation
m Add clarification about reporting_stanox vs original_loc_stanox fields
 
(12 intermediate revisions by 5 users not shown)
Line 6: Line 6:


== Data structure ==
== Data structure ==
<pre>
{
"header": {
"msg_type": "0003",
"source_dev_id": "VLA5",
"user_id": "#QHPA026",
"original_data_source": "SDR",
"msg_queue_timestamp": "1511528232000",
"source_system_id": "TRUST"
},
"body": {
"event_type": "DEPARTURE",
"gbtt_timestamp": "",
"original_loc_stanox": "",
"planned_timestamp": "1511524620000",
"timetable_variation": "0",
"original_loc_timestamp": "",
"current_train_id": "",
"delay_monitoring_point": "true",
"next_report_run_time": "9",
"reporting_stanox": "52701",
"actual_timestamp": "1511524620000",
"correction_ind": "false",
"event_source": "MANUAL",
"train_file_address": null,
"platform": "",
"division_code": "79",
"train_terminated": "false",
"train_id": "515G531I24",
"offroute_ind": "false",
"variation_status": "ON TIME",
"train_service_code": "25936005",
"toc_id": "79",
"loc_stanox": "52701",
"auto_expected": "true",
"direction_ind": "",
"route": "",
"planned_event_type": "DEPARTURE",
"next_report_stanox": "52226",
"line_ind": ""
}
}
</pre>


=== Header ===
=== Header ===
Line 17: Line 61:
|-
|-
|source_dev_id
|source_dev_id
|Where the movement is manually entered, set to the ID of the device that generated the movement message
|[[LATA]] or [[CICS Session]] of the inputting terminal
|-
|user_id
|[[NCI signon]] of the inputting user
|-
|-
|source_system_id
|source_system_id
Line 23: Line 70:
|-
|-
|original_data_source
|original_data_source
|Set to "TRUST', "TRUST DA" or "SDR" for a movement message
|Set to "GPS", "SDR", "SMART", "TOPS" or "TRUST DA" for a movement message
|-
|msg_queue_timestamp
|
|}
|}


=== Body ===
=== 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":""}}
Fields marked with an asterisk may not be present in some messages and your code should not
 
assume they will always be populated.


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

Latest revision as of 08:57, 17 November 2023

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": {
		"msg_type": "0003",
		"source_dev_id": "VLA5",
		"user_id": "#QHPA026",
		"original_data_source": "SDR",
		"msg_queue_timestamp": "1511528232000",
		"source_system_id": "TRUST"
	},
	"body": {
		"event_type": "DEPARTURE",
		"gbtt_timestamp": "",
		"original_loc_stanox": "",
		"planned_timestamp": "1511524620000",
		"timetable_variation": "0",
		"original_loc_timestamp": "",
		"current_train_id": "",
		"delay_monitoring_point": "true",
		"next_report_run_time": "9",
		"reporting_stanox": "52701",
		"actual_timestamp": "1511524620000",
		"correction_ind": "false",
		"event_source": "MANUAL",
		"train_file_address": null,
		"platform": "",
		"division_code": "79",
		"train_terminated": "false",
		"train_id": "515G531I24",
		"offroute_ind": "false",
		"variation_status": "ON TIME",
		"train_service_code": "25936005",
		"toc_id": "79",
		"loc_stanox": "52701",
		"auto_expected": "true",
		"direction_ind": "",
		"route": "",
		"planned_event_type": "DEPARTURE",
		"next_report_stanox": "52226",
		"line_ind": ""
	}
}

Header

Field Description
msg_type Set to '0003' for a movement message
source_dev_id LATA or CICS Session of the inputting terminal
user_id NCI signon of the inputting user
source_system_id Set to "TRUST" for a movement message
original_data_source Set to "GPS", "SDR", "SMART", "TOPS" or "TRUST DA" for a movement message
msg_queue_timestamp

Body

Fields marked with an asterisk may not be present in some messages and your code should not assume they will always be populated.

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


Network Rail Open Data Feeds
Data Feeds About the Feeds Account States Durable Subscriptions Example Code ( PHP / C# / Java / Ruby / Node.js) • Advanced UsesFAQ Release Notes
RTPPM RTPPM Feed
Train Movements Train Movements Feed Train Activation Train Cancellation Train Movement Train Reinstatement Change of Origin Change of Identity Change of Location TSPEED Field Planned Cancellations Cancellation Codes
TD TD Feed C-Class Messages S-Class Messages Train Describers TD Berths
VSTP VSTP Feed
TSR TSR Feed Route Codes
SCHEDULE SCHEDULE Feed TIPLOC Records Schedule and Location Records Association Records CIF Codes How Scheduling Works Allowances
Reference Data Reference Data Feed TOC Codes CIF Codes Delay Attribution Codes Identifying Locations (STANOX, TIPLOC, NLC and 3-Alpha Codes) STANOX Geographical Areas Train Planning data (BPLAN)