• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

meaning of "headcode" field in timetable data

Status
Not open for further replies.

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
I'm now working on some timetable data and looking for what the "headcode" field mean. It isn't the headcode as what is commonly known (the code used for signalling purpose).

I have seen the field used as the number portion of the RSID (such as on CrossCountry trains, or on SWR intercity services), the former Southern region headcode (on SWR local services such as 97 for Lymington branch line), the route number of a service bus (such as RA1 for the RailAir link), etc., and some left blank for passenger trains as well.

Actually what is the use of this "headcode" field?
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

Joined
24 Jul 2011
Messages
536
Location
Wigan
I'm now working on some timetable data and looking for what the "headcode" field mean. It isn't the headcode as what is commonly known (the code used for signalling purpose).

I have seen the field used as the number portion of the RSID (such as on CrossCountry trains, or on SWR intercity services), the former Southern region headcode (on SWR local services such as 97 for Lymington branch line), the route number of a service bus (such as RA1 for the RailAir link), etc., and some left blank for passenger trains as well.

Actually what is the use of this "headcode" field?
Which timetable feed/format are you using?
There are a number of timetable feeds from various bodies (official and otherwise), with subtle differences in data structure between some of them.
 

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
Which timetable feed/format are you using?
There are a number of timetable feeds from various bodies (official and otherwise), with subtle differences in data structure between some of them.
I'm using the data from National Rail in CIF format.
 

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,755
I'm now working on some timetable data and looking for what the "headcode" field mean. It isn't the headcode as what is commonly known (the code used for signalling purpose).

I have seen the field used as the number portion of the RSID (such as on CrossCountry trains, or on SWR intercity services), the former Southern region headcode (on SWR local services such as 97 for Lymington branch line), the route number of a service bus (such as RA1 for the RailAir link), etc., and some left blank for passenger trains as well.

Actually what is the use of this "headcode" field?
15 years ago the Headcode field was largely redundant, being used for a few remaining 2-digit route codes for the former Southern Region London suburban services. It was then purloined for use as the repository for the 4-digit code that would be used to create the RSIDs used for seat/sleeper reservations.

I wasn't aware of it also being used for RailAir buses numbers though.

In train planning, what most people think of as the Headcode (e.g. 1A66) is known as the Train ID. Can get confusing if two people from different parts of the rail industry talk about a headcode, not realising that one is referring to the Train ID and the other is referring to the other meaning.
 

Watershed

Veteran Member
Associate Staff
Senior Fares Advisor
Joined
26 Sep 2020
Messages
16,831
Location
UK
15 years ago the Headcode field was largely redundant, being used for a few remaining 2-digit route codes for the former Southern Region London suburban services. It was then purloined for use as the repository for the 4-digit code that would be used to create the RSIDs used for seat/sleeper reservations.

I wasn't aware of it also being used for RailAir buses numbers though.

In train planning, what most people think of as the Headcode (e.g. 1A66) is known as the Train ID. Can get confusing if two people from different parts of the rail industry talk about a headcode, not realising that one is referring to the Train ID and the other is referring to the other meaning.
Although the train ID has two more letters at the end, used to differentiate trains which would otherwise have the same "headcode".
 

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,755
Although the train ID has two more letters at the end, used to differentiate trains which would otherwise have the same "headcode".
Not in the CIF file that the OP is using. In that format it only shows the 4-character version.
 

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
15 years ago the Headcode field was largely redundant, being used for a few remaining 2-digit route codes for the former Southern Region London suburban services. It was then purloined for use as the repository for the 4-digit code that would be used to create the RSIDs used for seat/sleeper reservations.

I wasn't aware of it also being used for RailAir buses numbers though.

In train planning, what most people think of as the Headcode (e.g. 1A66) is known as the Train ID. Can get confusing if two people from different parts of the rail industry talk about a headcode, not realising that one is referring to the Train ID and the other is referring to the other meaning.
So in the library I'm writing I name the 1A66 field as "headcode", and the field in question in this thread "routeNumber" instead, which should be closest to what most people think.
 

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,755
So in the library I'm writing I name the 1A66 field as "headcode", and the field in question in this thread "routeNumber" instead, which should be closest to what most people think.
If you want to call the 1A66 field the headcode for your application that's up to you, but if it ever interacts with any other data feed that calls it the Train ID then you have a problem of interpretation - especially if you then make that data available to someone else who is working on a different definition.

As the Network Rail CIF specification defines the 1A66 field as the Train ID, why do you want to call it the Headcode instead?
 

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
If you want to call the 1A66 field the headcode for your application that's up to you, but if it ever interacts with any other data feed that calls it the Train ID then you have a problem of interpretation - especially if you then make that data available to someone else who is working on a different definition.

As the Network Rail CIF specification defines the 1A66 field as the Train ID, why do you want to call it the Headcode instead?
Because what most people think of headcode nowadays is the 1A66 code as used in signalling purpose. The term used by Network Rail may be a legacy from the Southern Region headcode era, but as it is not always used in this way now so continuing to calling it headcode seems to be misleading and also confusing as well.
 

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,755
Because what most people think of headcode nowadays is the 1A66 code as used in signalling purpose. The term used by Network Rail may be a legacy from the Southern Region headcode era, but as it is not always used in this way now so continuing to calling it headcode seems to be misleading and also confusing as well.
The term used by Network Rail is embedded in various rail operating systems and used in various operating notices. Headcode can be ambiguous, but Train ID is specific.
 

Tom

Member
Joined
19 Jan 2008
Messages
873
Location
35,000ft
Off the top of my head, I have seen the following terms used for what is referred to as a "headcode"... headcode, train reporting number, train reporting identity, train identity, train description, signalling identity, etc. There's more. I have seen headcode quite recently for something that is not a nAnn identity either, so it's certainly not "safe" to be used as the name in that context... but I suspect @miklcct is doing this in a hobbyist way and is unlikely to come across it.

Interestingly, the headcode fields for some routes on some operators do still retain the old headcode numbers of before. The first two digits of most SWR RSIDs for instance are all of the old headcodes, with the latter two digits being the latter 2 digits of the train identity. GWR ex Thames Trains routes did quite similar in the past, not sure if they do now.

Nevertheless, train identity is probably the safest thing to call it from a scheduling perspective even if we sometimes call it different things in different spheres of operations.
 

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
An old website states that
The RSID numbers (for trains with reservable seats) are stored in the same field within Network Rail's Train Service Database as the 2-digit route codes used in some parts of Southern England.
As a consequence, Customer Information Systems which were programmed to display a route code now display the first 2 digits of the RSID number.

The field is exactly what I'm talking about here. From what I seen in SWR, there are some services which still only have 2 digits in the field, such as the 97 Lymington Flyer, while the reservable services have 4 digits which form the numeric part of RSIDs.

However, as of 2022, are there still any customer-facing displays which display the former Southern Region 2-digit route code?
 

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
An old website states that


The field is exactly what I'm talking about here. From what I seen in SWR, there are some services which still only have 2 digits in the field, such as the 97 Lymington Flyer, while the reservable services have 4 digits which form the numeric part of RSIDs.

However, as of 2022, are there still any customer-facing displays which display the former Southern Region 2-digit route code?
Investigating the data further, I've found out on the SWR network that, if the first 2 digits of the RSID on a non-reservable service is the same as the route code, the full 4 digits is in the headcode field, however, if the first 2 digits are not the same as the route code, only the 2-digit route code is shown.

For example, the route code for Basingstoke - Waterloo stoppers is 64. If the RSID begins with 64 (such as SW6490 departing 07:06) 4 digits are listed in the headcode field, if not (e.g. SW3653 departing 08:53), only 2 digits (64) is in the headcode field.

Does it hold true for other train operating companies?
 

SargeNpton

Established Member
Joined
19 Nov 2018
Messages
1,755
Investigating the data further, I've found out on the SWR network that, if the first 2 digits of the RSID on a non-reservable service is the same as the route code, the full 4 digits is in the headcode field, however, if the first 2 digits are not the same as the route code, only the 2-digit route code is shown.

For example, the route code for Basingstoke - Waterloo stoppers is 64. If the RSID begins with 64 (such as SW6490 departing 07:06) 4 digits are listed in the headcode field, if not (e.g. SW3653 departing 08:53), only 2 digits (64) is in the headcode field.

Does it hold true for other train operating companies?
No, that is SWR's own policy. It's up to each TOC to determine how it wishes to allocate the 4-digit RSIDs.
 

miklcct

Established Member
Joined
2 May 2021
Messages
5,017
Location
Cricklewood
No, that is SWR's own policy. It's up to each TOC to determine how it wishes to allocate the 4-digit RSIDs.
I'm thinking that it can be useful to show this field in a user interface where the users can see such number physically. For example, if the user is told to take a "route 42 train to Guildford" from Wimbledon to Cobham, he can take the train in the picture shown:20220227_114644.jpg

So when is it appropriate to show this field as a "route number" in user interface in journey planners?
 

swt_passenger

Veteran Member
Joined
7 Apr 2010
Messages
34,322
I'm thinking that it can be useful to show this field in a user interface where the users can see such number physically. For example, if the user is told to take a "route 42 train to Guildford" from Wimbledon to Cobham, he can take the train in the picture shown:View attachment 112035

So when is it appropriate to show this field as a "route number" in user interface in journey planners?
It isn’t, because the only stock that displays it will be gone before anyone gets used to it again.
 
Status
Not open for further replies.

Top