Reference Data: Difference between revisions
PeterHicks (talk | contribs) m Add Train Planning data information |
PeterHicks (talk | contribs) |
||
(31 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Reference Data}} | {{DISPLAYTITLE:Reference Data}} | ||
Three sets of reference data are available from Network Rail. The ''All Reference Data'' topic must be selected and subscribed to in the ''My Feeds'' tab of the data feeds site to be able to access the CORPUS and SMART data. The Train Planning data is available from this site. See the [[About_the_feeds|about the feeds]] page for more details. | Three sets of reference data are available from Network Rail. The ''All Reference Data'' topic must be selected and subscribed to in the ''My Feeds'' tab of the data feeds site to be able to access the CORPUS and SMART data. The Train Planning data is available from this site. See the [[About_the_feeds|about the feeds]] page for more details. | ||
Other useful reference sources are also listed. | Other useful reference sources are also listed. | ||
= Geospatial data = | |||
Network Rail have published geospatial data for track infrastructure on the [https://raildata.org.uk/dashboard/dataProduct/P-d6c0c7ee-6743-4999-9b9e-d2dd39585bdb/overview Rail Data Marketplace], licensed under the [https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/ OGL]. | |||
This data was previously available [https://github.com/openraildata/network-rail-gis on the openraildata GitHub organisation], but has been archived. However, the script to create [https://www.geopackage.org/ Geopackage] files have been created and may be useful to those wanting to convert the data. | |||
= CORPUS: Location Reference Data = | = CORPUS: Location Reference Data = | ||
Line 11: | Line 16: | ||
== Downloading CORPUS Data == | == Downloading CORPUS Data == | ||
To download the data, visit | To download the data, visit https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=CORPUS | ||
== CORPUS Data Format == | == CORPUS Data Format == | ||
Line 50: | Line 55: | ||
== Downloading SMART Data == | == Downloading SMART Data == | ||
To download the data, visit | To download the data, visit https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=SMART | ||
== SMART Data Format == | == SMART Data Format == | ||
Line 76: | Line 81: | ||
|- | |- | ||
|BERTHOFFSET | |BERTHOFFSET | ||
|Difference between the time | |Difference between the time the berth event occurs and the time to be recorded in TRUST, in seconds | ||
|- | |- | ||
|PLATFORM | |PLATFORM | ||
Line 146: | Line 151: | ||
An in-depth [[SmartBerthDetail|overview of how to use SMART data]] is available. | An in-depth [[SmartBerthDetail|overview of how to use SMART data]] is available. | ||
= Train Planning | = BPLAN Geography = | ||
Twice a year, [[BPLAN_Geography|a set of geographical data]] is released from Network Rail which contains data to be used when planning trains. It also includes other data, such as platform numbers at stations, and details of activity codes used in CIF. | |||
The files are uploaded to the wiki, including an archive of some historical files, and are available [[BPLAN_Geography_Data|on a separate page]]. | |||
BPLAN was previously available through the separate [[Network Rail API Platform]], but registrations are now suspended. | |||
= Train Planning Network Model = | |||
The Train Planning | The Train Planning Network Model contains very detailed information on the network model used by TPS, the Train Planning System. There is no formal documentation available<ref>https://www.whatdotheyknow.com/request/documentation_for_tps_reference</ref>, as this is a set of data internal to TPS. | ||
== Downloading the data == | |||
The data is available via the [https://raildata.org.uk/dashboard/dataProduct/P-b0d4f6aa-c1b8-4d1a-a1c0-71ba90e26e35/documentation Rail Data Marketplace], and the [https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=TPS Network Rail Open Data platform]. These sets of data are identical, and the data is updated each night. | |||
The raw data is XML in tarred bzip2 (tar.bz2) format, and the current schema for the Network Model is available [[Media:TPS_Schema_20200818.xsd.gz|here]]. | |||
The previous schema, valid until an unknown date in 2020, is available [[Media:TPS_Schema.xsd.gz|here]]. | |||
= Other Sources = | = Other Sources = | ||
* [http:// | * [http://www.railwaycodes.org.uk/index.shtml Phil Deaves] has compiled a reference site listing location codes (CRS, STANOX and TIPLOC) as well as a comprehensive listing of other railway codes | ||
* [http://data.gov.uk/dataset/naptan NaPTAN] (National Public Transport Access Nodes) is provided by the Department for Transport and is the single government source for all public transport stops/stations in the UK, also including bus stops, ferry terminals, airports, metro stations, and heritage railways, as well as associated metadata, including the location of entrances to stations, and platform locations in some circumstances. Contains ATCO, CRS and TIPLOC codes and latitude/longitudes. | * [http://data.gov.uk/dataset/naptan NaPTAN] (National Public Transport Access Nodes) is provided by the Department for Transport and is the single government source for all public transport stops/stations in the UK, also including bus stops, ferry terminals, airports, metro stations, and heritage railways, as well as associated metadata, including the location of entrances to stations, and platform locations in some circumstances. Contains ATCO, CRS and TIPLOC codes and latitude/longitudes. | ||
* | = Programmatic Download = | ||
The CORPUS, SMART and TPS reference data can be downloaded programmatically using the command | |||
<nowiki>curl -L -u '<USERNAME>:<PASSWORD>' -o '<FILENAME>' 'https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=<DATASET>'</nowiki> | |||
where | |||
* <code><USERNAME></code> and <code><PASSWORD></code> are from your NR Open Data login | |||
* <code><FILENAME></code> is what you want the locally downloaded file to be called | |||
* <code><DATASET></code> is one of <code>CORPUS</code>, <code>SMART</code> or <code>TPS</code> | |||
This allows you to automate download of the data when it is updated | |||
= References = | |||
<references /> | |||
{{Navtable-DataFeeds}} | {{Navtable-DataFeeds}} |
Latest revision as of 12:22, 15 August 2024
Three sets of reference data are available from Network Rail. The All Reference Data topic must be selected and subscribed to in the My Feeds tab of the data feeds site to be able to access the CORPUS and SMART data. The Train Planning data is available from this site. See the about the feeds page for more details.
Other useful reference sources are also listed.
Geospatial data
Network Rail have published geospatial data for track infrastructure on the Rail Data Marketplace, licensed under the OGL.
This data was previously available on the openraildata GitHub organisation, but has been archived. However, the script to create Geopackage files have been created and may be useful to those wanting to convert the data.
CORPUS: Location Reference Data
This is provided from the CORPUS system (Codes for Operations, Retail & Planning – a Unified Solution). The data is a periodically-updated snapshot of the CORPUS database. This can be used to translate STANOX, TIPLOC, NLC, UIC and 3-alpha (CRS) codes to location descriptions.
Downloading CORPUS Data
To download the data, visit https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=CORPUS
CORPUS Data Format
CORPUS data is supplied as a plain text file containing a JSON representation of the data. Entries comprise the following fields (not all fields may contain data):
Field | Description |
---|---|
STANOX | STANOX code |
UIC | UIC code |
3ALPHA | 3-letter location code |
TIPLOC | TIPLOC code |
NLC | NLC code |
NLCDESC | Description of the NLC |
NLCDESC16 | NLC description (16-character version) |
SMART: Berth Stepping Data
The SMART database contains details of train describer berths and allows movements into berths to be translated into arrivals and departures from locations. The data feed contains a periodically-updated snapshot of the SMART database.
Downloading SMART Data
To download the data, visit https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=SMART
SMART Data Format
SMART data is supplied as a plain text file containing a JSON representation of the data. Entries comprise the following fields (not all fields may contain data):
Field | Description |
---|---|
TD | Train describer area |
FROMBERTH | TD berth that movement is from |
TOBERTH | TD berth that movement is to |
FROMLINE | Line which the movement is from |
TOLINE | Line which the movement is to |
BERTHOFFSET | Difference between the time the berth event occurs and the time to be recorded in TRUST, in seconds |
PLATFORM | Platform |
EVENT | One of A, B, C, D |
ROUTE | |
STANOX | STANOX code for location |
STANME | Abbreviated description of location |
STEPTYPE | One of B, F, C, D, I, T, E |
COMMENT |
EVENT | Description |
---|---|
A | Arrive Up |
B | Depart Up |
C | Arrive Down |
D | Depart Down |
STEPTYPE | Description |
---|---|
B | Between |
F | From |
T | To |
D | Intermediate First |
C | Clearout |
I | Interpose |
E | Intermediate |
An in-depth overview of how to use SMART data is available.
BPLAN Geography
Twice a year, a set of geographical data is released from Network Rail which contains data to be used when planning trains. It also includes other data, such as platform numbers at stations, and details of activity codes used in CIF.
The files are uploaded to the wiki, including an archive of some historical files, and are available on a separate page.
BPLAN was previously available through the separate Network Rail API Platform, but registrations are now suspended.
Train Planning Network Model
The Train Planning Network Model contains very detailed information on the network model used by TPS, the Train Planning System. There is no formal documentation available[1], as this is a set of data internal to TPS.
Downloading the data
The data is available via the Rail Data Marketplace, and the Network Rail Open Data platform. These sets of data are identical, and the data is updated each night.
The raw data is XML in tarred bzip2 (tar.bz2) format, and the current schema for the Network Model is available here.
The previous schema, valid until an unknown date in 2020, is available here.
Other Sources
- Phil Deaves has compiled a reference site listing location codes (CRS, STANOX and TIPLOC) as well as a comprehensive listing of other railway codes
- NaPTAN (National Public Transport Access Nodes) is provided by the Department for Transport and is the single government source for all public transport stops/stations in the UK, also including bus stops, ferry terminals, airports, metro stations, and heritage railways, as well as associated metadata, including the location of entrances to stations, and platform locations in some circumstances. Contains ATCO, CRS and TIPLOC codes and latitude/longitudes.
Programmatic Download
The CORPUS, SMART and TPS reference data can be downloaded programmatically using the command
curl -L -u '<USERNAME>:<PASSWORD>' -o '<FILENAME>' 'https://publicdatafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=<DATASET>'
where
<USERNAME>
and<PASSWORD>
are from your NR Open Data login<FILENAME>
is what you want the locally downloaded file to be called<DATASET>
is one ofCORPUS
,SMART
orTPS
This allows you to automate download of the data when it is updated
References
Network Rail Open Data Feeds | |
---|---|
Data Feeds | About the Feeds • Account States • Durable Subscriptions • Example Code ( PHP / C# / Java / Ruby / Node.js) • Advanced Uses • FAQ • 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) |