CIF Schedule JSON Feed location record passenger pick up point or not?

154 views
Skip to first unread message

Michael Flynn

unread,
Feb 25, 2025, 5:57:43 AMFeb 25
to A gathering place for the Open Rail Data community
On the OpenRailData wiki the link for the spec (https://wiki.openraildata.com/images/2/27/CIF_End_User_Spec_v29.pdf) is to one dated 2015.  I have found a more up to date CIF spec (https://www.rspaccreditation.org/downloadPublic.php?DOCUMENT=RSPS5046+P-04-01+Timetable+Information+Data+Feed+Interface+Specification.pdf&ID=1427) dated 2024 from this page on the net, https://www.rspaccreditation.org/publicDocumentation.php#RSPS5xxx.

It was possible from the 2015 document to determine whether a location record was a passenger pick up point (station) from activity codes, i.e., if the field contained the character 'U'. (See Appendix A, note 3). The 2024 document notes the Activity field but there is no list of codes that I can find as there were on the 2015 document.  

It does however state if there is no Public Arrival (or Public Departure) time this field will default to 0000 (what about midnight!?) and presumably means the train doesn't stop at the location (station) or at least doesn't stop for passengers.  

The JSON File Format documentation (https://wiki.openraildata.com/index.php/JSON_File_Format) does not allude to Activity Codes.   (Is it noted somewhere that I'm missing?)  Possibly because they are deprecated, or just not included in the feed.  Is this so?

Whilst specifications are great it's also the case that they're unlikely to be perfect.  But it's also an example where  community driven websites can never really hope to be properly updated.  A professionally produced website with paid staff would be expected to keep such information properly (or at least, better) updated.  Just an observation :)

Regarding my query, I am converting from the CIF format to JSON.  Are my assumptions my correct and would I be right to deprecate (or override when using JSON) my original code relating to activity codes and instead just use the public arrival and departure times as to whether a train stops at location or not?  (When this is the case, I can see there is also often (always?) a scheduled pass time).  Is there a more definitive way from the JSON feed to determine whether a location record denotes a passenger pick up point?  I'd be dropping midnight stops otherwise!

Any help gratefully appreciated.

Mike

Tom Cairns

unread,
Feb 25, 2025, 6:03:01 AMFeb 25
to openrail...@googlegroups.com

The JSON feed is a nearly 1-1 direct translation of the Network Rail CIF feed – v29 remains the latest version of that document. RSPS5046 refers to the RSP version of the CIF and should also be best read in context of the NR CIF document, it mentions that it’s derived from it at the start. I would suggest the same for the JSON feed, as those codes are directly lifted from the CIF.

 

Use the Network Rail CIF appendices to get a list of valid activity codes (or perhaps BPLAN? Someone can correct me here).

 

A pick up only station would be ‘U ’ rather than just U from memory. An open call is ‘T ’. You will never have a train in the GBTT timed at 0000.

 

You should use activity codes to get the correct usage of GBTT arr/dep. There are some cases (particularly around the Caledonian Sleeper) where the GBTT times are populated but should not be advertised to the public.

 

Tom

 

 

--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/openraildata-talk/10f6bb18-cb19-4236-b223-071c51495f70n%40googlegroups.com.

Jon Wood

unread,
Feb 25, 2025, 6:09:23 AMFeb 25
to openrail...@googlegroups.com
It’s been a long time since I used that field but does this field indicate all stations or just literal ‘pick up’ points? As there are some calling points where a train is only actually booked to drop off passengers.

Personally I’ve been using passing times as an indicator that a service doesn’t stop which is fine for me, but there could well be cases where a passenger service stops somewhere that isn’t somewhere they can get off. I believe there is somewhere like this on the Caledonian sleeper?

Michael Flynn

unread,
Feb 25, 2025, 6:17:47 AMFeb 25
to A gathering place for the Open Rail Data community
>> A pick up only station would be ‘U ’ rather than just U from memory. An open call is ‘T ’.
Yes, I see that, a U and or a T, etc..  My original code will do that (hopefully, I assume:).

>> You will never have a train in the GBTT timed at 0000
Is this definitive?  

>> using passing times as an indicator that a service doesn’t stop which is fine for me
It will be good enough for me too, combined with the 0000 dep/arr time, except..

..where's the activity codes on the JSON feeds?  This would be best for me, I wouldn't need to change my logic.  I don't see them anywhere though.



Peter Hicks (Poggs)

unread,
Feb 25, 2025, 6:19:21 AMFeb 25
to A gathering place for the Open Rail Data community
Hi Mike


On 25 Feb 2025, at 10:57, Michael Flynn <mi...@a1publishing.com> wrote:


RSPS5046 is not the CIF specification.  It even says that in the Acknowledgements:

"The information provided in this document regarding data content is sourced from the ’Lists of Valid Values’ Appendix in the ’Common Interface File - End User Specification’ (available from ASSIST under RSPS5004: ‘Network Rail Common Interface File - End User Specification’)."

And to try to stop the panic over “we don’t have the latest CIF specification” - Issue 29 (June 2014), which is more than a decade old, is still entirely valid.  Issue 30 merely has changes to the wording to reflect changes in internal processes, and minor updates to Appendix A, which should be reflected on the wiki.  If it’s not, you could always update it - but I’m afraid you’ll have to seek your own documentation for how to make changes to a wiki.

Incidentally, I”m sure you’re aware that your website at https://www.stationboard.uk/index.php?station1=SDC&station2=HHY is not bringing up any live data at all.


Peter

Matthew Burdett

unread,
Feb 25, 2025, 6:24:12 AMFeb 25
to openrail...@googlegroups.com
If anyone is looking for the activity codes they are here:

https://wiki.openraildata.com/index.php/Activity_codes

--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.

Michael Flynn

unread,
Feb 25, 2025, 6:24:47 AMFeb 25
to A gathering place for the Open Rail Data community
Hi Peter,

LOL - no I wasn't aware, thanks :)

Mike

Peter Hicks (Poggs)

unread,
Feb 25, 2025, 6:31:38 AMFeb 25
to A gathering place for the Open Rail Data community


On 25 Feb 2025, at 11:17, Michael Flynn <mi...@a1publishing.com> wrote:

>> You will never have a train in the GBTT timed at 0000
Is this definitive?  

Yes - and you could check this by looking for any train advertised to arrive or depart at 0000 in the CIF, and find there are none.


Peter

Evelyn Snow

unread,
Feb 25, 2025, 7:29:43 AMFeb 25
to openrail...@googlegroups.com
Hi Mike,

The fact that the wiki is written by feeds users allows us to offer a perspective that's quite hard
for professionally written documentation to capture. It's an area where we have a real edge against
any documentation – real or hypothetical – from official sources.

The reality is that documentation is unlikely to be improved in the way you suggest, and that the
wiki is a valuable resource which offers supplementary information in some cases, and acts as a
substitute for documentation which doesn't exist in others. The wiki depends on contributions from
people minded to improve it, and your own contributions would be most welcome.

Evelyn

Michael Flynn

unread,
Feb 25, 2025, 8:16:44 AMFeb 25
to A gathering place for the Open Rail Data community
Hi Evelyn, 

I get into these discussion and I really don't want or intend to.  You have your opinions, just that I have mine too.  I'd say they're probably equally valid.  I think the wiki is very good, very useful and would always be a great alternative.  I just think documentation produced by the providers would be better.  I really didn't want to get into arguments or discussions about it though.  It's usually more trouble than it worth and I forgot to keep my opinions to myself this time.  

But it's open data.  It is what it is.  So when my link to OpenLDBWS stops returning data it's all very difficult. It is what it is.

But, yes, also, for example, I'm glad of pages like this;

And also lookout for my next post "Why has my OpenLDBWS just stopped working" if I don't work it out myself :)..

Mike

Evelyn Snow

unread,
Feb 25, 2025, 8:29:13 AMFeb 25
to openrail...@googlegroups.com
Hi Mike,

The "request account" link can be found on the top right of the wiki.

Evelyn
> --
> You received this message because you are subscribed to the Google Groups "A
> gathering place for the Open Rail Data community" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to openraildata-t...@googlegroups.com.
> To view this discussion, visit https://groups.google.com/d/msgid/
> openraildata-talk/9499f0c8-4af3-4227-b175-2b5eeedbba0en%40googlegroups.com.

Ian Sargent

unread,
Feb 25, 2025, 9:01:33 AMFeb 25
to A gathering place for the Open Rail Data community
On Tuesday, 25 February 2025 at 11:17:47 UTC Michael Flynn wrote:
>> A pick up only station would be ‘U ’ rather than just U from memory. An open call is ‘T ’.
Yes, I see that, a U and or a T, etc..  My original code will do that (hopefully, I assume:).

>> You will never have a train in the GBTT timed at 0000
Is this definitive?  

>> using passing times as an indicator that a service doesn’t stop which is fine for me
It will be good enough for me too, combined with the 0000 dep/arr time, except..

..where's the activity codes on the JSON feeds?  This would be best for me, I wouldn't need to change my logic.  I don't see them anywhere though.

In the raw CIF feed (I'm not experienced with JSON) there are columns for: 1) working time arrivals/departures; 2) passing times; and 3) advertised arrivals/departures.

For the first two of those the values will be between 0001-2359. Midnight is deliberately excluded from timings to avoid any confusion as to whether it's 0000 or 2400, and what day that is.

For any timing point where the working time arrival/departure is shown, the activity code will determine whether it's a stop for passenger pusposes or for operating purposes. If it's an advertised passenger stop then the advertised arrival/departure time will be displayed in the relevant column. If it's not an advertised stop then the "0000" string indicates the absence of an advertised time.

Activity codes that show a passenger stop at an intermediate station are: D (set down only), U (pick up only), T (train picks up and sets down), R (request stop). At the Origin station, be default, a passenger train will be an advertised pick up unless another activity code is present. Similarly, at the Destination station, by default an advertised set down unless another activity code is present.

Michael Flynn

unread,
Feb 25, 2025, 10:37:15 AMFeb 25
to A gathering place for the Open Rail Data community
The original subject seems to have been lost.  Are the activity codes left out of the JSON feeds? 

Peter Hicks (Poggs)

unread,
Feb 25, 2025, 10:41:31 AMFeb 25
to A gathering place for the Open Rail Data community
On 25 Feb 2025, at 13:35, Michael Flynn <mi...@a1publishing.com> wrote:

The original subject seems to have been lost.  Are the activity codes left out of the JSON feeds? 

You have dodged the polite suggestion to, if you find the documentation lacking, to apply for an account and update the wiki.

To answer your question, activity codes are not listed as a field in https://wiki.openraildata.com/index.php/Schedule_Records, so no, they do not look like they are included in the JSON data.  You can also look in the JSON schedule data to see if the activities are included.

If you are still sure you are making the right choices, you may be able to infer a pick-up only activity at an intermediate location by the absence of a arrival time, and a set-down only activity by absence of a departure time.  But if this is not suitable for your use-case, then use the CIF.


Peter

Michael Flynn

unread,
Feb 25, 2025, 2:37:07 PMFeb 25
to A gathering place for the Open Rail Data community
Peter,

As opposed to your dropping my perfectly polite reply and "pending for review" the next one for a couple of hours?  Yes, I got the message.  Listen, no hard feelings, and if you don't like my opinions fine but please lets keep this professional.  It's exactly my point.  You wouldn't want my contribution anyway.  

Here's the TfL equivalent open data for comparison  https://tfl.gov.uk/info-for/open-data-users/our-open-data#on-this-page-1.

As regards my OpenLDBWS data not returning, well, it's opened my eyes, even though I knew it before.  There's really no-one for me to contact about why my feed has been stopped.  Of course it will be something silly, probably at my end, but it's not the point.  If it were a professional setup I could send at least a support ticket.  As it there's just broken links to National Rail, if you can even find them, etc., etc.  Probably even is a link somewhere, who knows?   So I'm taking the decision to drop my Stationboard site, I really don't need it anyway, and reconsidering my use of the CIF schedules.  If my link to this feed stops working well I'd similarly just be left in the cold.  I'm not trying to win any arguments or score points, it's just the facts of the matter.

I honestly think, from my commercial point of view, as it is, I'm better off not relying on uk rail open data at all.    

Here's the TfL equivalent open data for comparison  https://tfl.gov.uk/info-for/open-data-users/our-open-data#on-this-page-1.

Regards,
Mike

Peter Hicks (Poggs)

unread,
Feb 25, 2025, 2:38:12 PMFeb 25
to A gathering place for the Open Rail Data community
Hi Mike

I put you on moderation (for the record, I've only had to do this twice in over a decade) because your actions are disruptive to the group.  You are going around in circles, taking a thread off in multiple different directions (such as this one, complaining now about OpenLDBWS not working for you), and you're being disrespectful.

Whether you intend to be like this or not, I don't care - but I really do care about your impact on the group.  By moderating your posts, I temporarily pause your ability to impact on the 1,000+ people subscribed to this group, many of whom are probably rolling their eyes.

I dropped one of your messages because, for the second time in a couple of minutes, you asked "So does the JSON file contain activities?" on two different replies to the same thread.  Please - be patient.  Nobody here is paid to offer advice or help - we do it because we care.  Nearly everyone else manages to be civil and respectful.

If you don't get on well with Open Data, then don't use it.  I am sure RDG will let you sign up for a commercial feed to LDBWS in exchange for money so that you have somewhere to turn to for support, but equally they may not offer any uptime guarantee or formal support because it's quite a simple service.


Peter

David Wheatley

unread,
Feb 26, 2025, 3:20:54 AMFeb 26
to A gathering place for the Open Rail Data community
Yes, activities are not included in the JSON data.

I spent a decent while writing a system to store the JSON version of the data before actually noticing this, and this was the primary thing I needed from the data at the time! I had assumed it was a 1:1 map of the CIF but it isn't. I seem to remember enroute changes to reservation or catering records are also not included too.

David
Reply all
Reply to author
Forward
0 new messages