You need to enable JavaScript to run this app.

Skip to main content

RE: AI Bus Timetables
You've probably already seen it, but bustimes data sources are here: https://bustimes.org/data

I guess creating a timetable from scratch, your main data sources are going to be NaPTAN and NPTG. 

You can probably then use the OpenStreetMap Distance Matrix API to calculate the distance of your route from point to point, and then whatever average speed you think the bus would be travelling?
Forum Moderator | Find NEB on facebook
RE: AI Bus Timetables
Not sure using timetable data is the right data to be used to generate another timetable. You need some form of data set which calculates the distance to travel between two points imo which takes account of traffic etc.

Using live bus data (BODS), and calculating the actual time for the vehicles to do the journey times would produce more reliable timetables but you'll end up with the sort of nonsense that First is publishing in recent years.
RE: AI Bus Timetables
(16 Jan 2025, 12:08 pm)Storx wrote Not sure using timetable data is the right data to be used to generate another timetable. You need some form of data set which calculates the distance to travel between two points imo which takes account of traffic etc.

Using live bus data (BODS), and calculating the actual time for the vehicles to do the journey times would produce more reliable timetables but you'll end up with the sort of nonsense that First is publishing in recent years.

I'm not bothered how it looks. I just want a high frequency timetable even if its not clockface.
Twitter: @ASX_Terranova
Blog: https://asxterranova.home.blog/
RE: AI Bus Timetables
(16 Jan 2025, 12:53 pm)ASX_Terranova wrote I'm not bothered how it looks. I just want a high frequency timetable even if its not clockface.

The problem is if you use timetable data then the data is flawed.

In an ideal world you'd need something like

Calculate the times using some form of live data between points in 30 minute periods.
Select how many resources you're willing to put on your route.
Let AI work how the best use of those resources to give the most runs with enough padding so they can recover from delays.

I'd assume it's how the First system works behind the scenes or similar to it.
RE: AI Bus Timetables
(16 Jan 2025, 1:34 pm)Storx wrote The problem is if you use timetable data then the data is flawed.

In an ideal world you'd need something like

Calculate the times using some form of live data between points in 30 minute periods.
Select how many resources you're willing to put on your route.
Let AI work how the best use of those resources to give the most runs with enough padding so they can recover from delays.


I'd assume it's how the First system works behind the scenes or similar to it.

I did find this, but its been about 5 years since I have touched python.

https://pypi.org/project/BODSDataExtractor/ 

And to answer the highlighted point, thats exactly what I want. A robust schedule with enough slack to avoid major unreliability.
Twitter: @ASX_Terranova
Blog: https://asxterranova.home.blog/
RE: AI Bus Timetables
(16 Jan 2025, 1:51 pm)ASX_Terranova wrote I did find this, but its been about 5 years since I have touched python.

https://pypi.org/project/BODSDataExtractor/ 

And to answer the highlighted point, thats exactly what I want. A robust schedule with enough slack to avoid major unreliability.

To be honest the first step id imagine you'd have to do is create some form of database logging the live times. 

I don't believe there's anything around currently. Then from there start analysing that. 

I've messed around with the BODS data and it's a bit all over the place but it's quite simple once you get the hang of it. I'm PHP not Python though.

I'd assume it's what the software which First uses does behind the scenes. 

Quite complex though mind.
RE: AI Bus Timetables
Excel and plenty of formulas (with a bit of guess work lookong at existing timetables haha) is how I normally come up with suggestion timetables / boards.

If in doubt about timings, normally Google Maps and of appropriate, stick an extra few minutes on.