Nationwide Modes and routes to ATOC

Hello Everyone and merry christmas to all i hope everyone is well.

Is there a dataset you folk are aware of that links the bus route each for each bus naptan and the same for train stations around the nation in a similar fashion to Tfl currently does for the greater london area.

I am aware of the naptan dataset i just don’t think it provides that kind of information

@tai

There are two ways to do this:

Good luck!

Are you asking for a list of bus routes (& Operators) that serve each bus stop listed in the Naptan dataset? If so, I don’t think one exists. You may be able to create your own by parsing the timetables used by the DfT’s Bus Open Data Service - See “Timetables data” at https://data.bus-data.dft.gov.uk/downloads/

I can’t help with the train side of things, maybe here https://wiki.openraildata.com/index.php?title=About_the_National_Rail_Feeds may point you in the right direction?

Simon

@SJCooper @tai

The station location dataset is in XML - “Stations V4 XML Feed”

This is the only source, should you want it, of national rail station accessibility data.

There is a set of Traveline equivalents to the Datastore Journey Planner files which are basically structured the same way, that is with Routes, RouteSections and Stops within a XML file for each route. However going through these would be a gargantuan task and any coding approach would be hampered by the much greater complexity of some routes outside London with (say) a different set of villages being by-passed by each journey. It would also be like painting the Forth Bridge as it would be in a constant state of flux. TfL routes are so much easier to deal with, as the vast majority are end-to-end with no variations.

@mjcarchive But that method does work but there is a quite pushed cron job to work though it every time it changes.

@tai

There is also the TNDS XML feed (ftp://ftp.tnds.basemap.co.uk) which contains, amongst other things, all the bus routes and timetables in the country. It has the advantage over BODS in that it also contains the Tfl data, which BODS (mostly) does not. If you want coaches as well, you should add the NOC feed (http://www.travelinedata.org.uk/noc/api/1.0/nocrecords.xml)

For National Rail you want https://publicdatafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_FULL_DAILY&day=toc-full.CIF.gz You need to convert TIPLOCs to Naptan codes: simply 910G{tiploc}

Some of these feeds require registration/authentication.

Note that the TransXChange data (TNDS, BODS) has a pretty complex structure which takes a fair bit of analysis (and reading the documentation) to process

In terms of responding to change, it becomes a question of how up-to-date you need to be. For my purposes I find it sufficient to take the National Rail, NPTG, NAPTAN, NOC, TNDS & BODS data once a week and to check the Tfl data summary (https://api.tfl.gov.uk/Line/Mode/{modes}/Route) once a day - this also picks up their weekly(-ish) main update