<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://choo.express/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://choo.express/" rel="alternate" type="text/html" hreflang="en-GB" /><updated>2026-12-04T17:11:36+00:00</updated><id>https://choo.express/blog/feed.xml</id><title type="html">Choo!</title><subtitle>A countdown to the next train past your spot.</subtitle><entry><title type="html">How Choo predicts when a train will pass your bridge</title><link href="https://choo.express/blog/how-choo-works/" rel="alternate" type="text/html" title="How Choo predicts when a train will pass your bridge" /><published>2026-12-04T00:00:00+00:00</published><updated>2026-12-04T00:00:00+00:00</updated><id>https://choo.express/blog/how-choo-works</id><content type="html" xml:base="https://choo.express/blog/how-choo-works/"><![CDATA[<p>If you’ve ever stood on a footbridge with a small child waiting for a train, you’ll know the experience of trying to figure out whether it’s worth waiting for the next one. Departure boards don’t help that much: they tell you when a train leaves a station, but maybe you’re not at a station. Maybe you’re on a bridge halfway between two, or on a footpath beside the line, or at the end of a platform where the fast trains run straight through.</p>

<p>I built <strong><a href="https://choo.express">Choo</a></strong> to answer that question. It’s an iOS app that monitors the railways in Great Britain. You put a pin where you’re standing, and it counts down to the next train past it. When it’s close, the countdown runs to the second.</p>

<p>The tricky part is that there’s no live GPS map of British trains. Operators don’t publish live positions, so nobody outside the railway can simply look up where a train is right now. What <em>is</em> published, openly, is the timetable, live reports of trains reaching and leaving places on it, and the signalling’s record of each train moving from one section of line to the next. Everything Choo shows is worked out from those.</p>

<p>This post explains how it all fits together. I’m focusing on National Rail trains; Choo also covers the Tube, Overground, DLR and Elizabeth line from Transport for London’s data, but that’s a story for another time.</p>

<hr />

<h2 id="1-a-train-that-stops-at-both-ends">1. A train that stops at both ends</h2>

<p>Let’s start with the easiest case. You’re standing beside the line somewhere between two stations, and a train is going to stop at both of them:</p>

<p><img src="/blog/how-choo-works/spot.svg" alt="A spot a quarter of the way along the track from Tilehurst to Pangbourne" /></p>

<p>Suppose the train leaves Tilehurst at 11:15:00 and arrives at Pangbourne at 11:17:00. If you’re a quarter of the way along, a sensible first guess is a quarter of the way through the journey: 11:15:30. Everything else in this post is about refining this guess, and making it more accurate.</p>

<h3 id="distance-along-the-track">Distance along the track</h3>

<p>How to measure distance between the stations? As the crow flies is no good: railways curve, and a spot on the outside of a bend can look much nearer one station than it really is along the line.</p>

<p><img src="/blog/how-choo-works/crow-vs-track.svg" alt="A sketch map: the railway curves north between Tilehurst and Pangbourne. Along the track your spot is 30% of the way; along a straight line between the stations it looks only 22%." /></p>

<p>So first we need the shape of the railway. That comes from <strong><a href="https://www.openstreetmap.org/">OpenStreetMap</a></strong>, whose volunteer-mapped railway lines are detailed and well kept. Choo uses about 32,000 km of them across Great Britain: the main lines, freight branches, the Tube and light rail. With those, “how far along” can be measured along the rails.</p>

<h3 id="trains-dont-go-at-a-steady-speed">Trains don’t go at a steady speed</h3>

<p>A quarter-of-the-way guess assumes a constant speed. In reality, a train leaving Tilehurst is still picking up speed as it passes a spot just outside the station, and one approaching Pangbourne is braking. A steady-speed guess will be too early just after Tilehurst, and too late just before Pangbourne.</p>

<p>Choo models the run the way trains typically go: pulling away, speeding up to line speed, then braking for the next stop. Different trains have different figures: an electric unit accelerates faster than a diesel, and a heavy freight train much more slowly than either. The running time between the two stops still comes from the timetable; the model just decides how that time is spread along the way.</p>

<p>OpenStreetMap also records <strong>speed limits</strong> for most of Great Britain’s main lines, which Choo factors into the calculations.</p>

<hr />

<h2 id="2-knowing-when-trains-leave-and-arrive">2. Knowing when trains leave and arrive</h2>

<p>Step 1 assumes we already know when the train leaves one station and reaches the next, but where do we get that data from? There are several open datasets we can use:</p>

<ul>
  <li><strong><a href="https://wiki.openraildata.com/index.php/Darwin">Darwin</a></strong>, from National Rail Enquiries, holds each day’s passenger trains and powers station departure boards.</li>
  <li><strong>Network Rail’s <a href="https://wiki.openraildata.com/index.php/SCHEDULE">SCHEDULE</a></strong> has <em>every</em> train: passenger, freight, engineering. That’s about 730,000 schedules, plus short-notice trains (mostly freight) planned on the day.</li>
</ul>

<p>Because trains don’t always run to time, Choo also listens to two live feeds: <strong>Darwin</strong> (for forecasts, platforms and cancellations) and Network Rail’s <strong><a href="https://wiki.openraildata.com/index.php/TRUST">TRUST</a></strong> (which reports when each train actually arrives, leaves or passes each place in its timetable).</p>

<p>Both feeds give times to the <strong>minute</strong>, but we can do better than that. To get to the second, we need the signalling.</p>

<hr />

<h2 id="3-non-stop-trains-and-missing-stations">3. Non-stop trains and missing stations</h2>

<p>Not every train stops at both stations. Many trains run straight through. Luckily, schedules don’t just list stops, they also list <strong>timing points</strong>: stations and other points that a train <em>passes</em>. A pass time works just as well as a departure time.</p>

<p>Choo looks at every <strong>leg</strong> of a train’s journey, from one timing point to the next, and checks whether it runs past your spot. But this doesn’t solve everything: a train’s timetable doesn’t list every station it goes through. A fast train can have long gaps with no timing points listed in its timetable, meaning our estimate gets less accurate.</p>

<p><img src="/blog/how-choo-works/legs.svg" alt="A stopping train has timing points at Reading, Tilehurst, Pangbourne and Goring &amp; Streatley. A fast train to Didcot has only Reading and Goring &amp; Streatley here." /></p>

<hr />

<h2 id="4-the-signalling">4. The signalling</h2>

<p>To get times to the second, Choo uses the railway’s signalling. I will confess, until I made Choo, I didn’t really understand what signalling <em>was</em>, other than something that failed regularly on certain Tube lines. So here’s a primer.</p>

<p>Trains take a very long time to stop, and a driver can’t rely on seeing the train in front, so the railway keeps trains apart by never letting two of them onto the same stretch of line.</p>

<p>A main line is divided into <strong>sections</strong>, each with a signal at its entrance. Only one train is allowed in a section at a time. Equipment in the track detects which sections have a train in them, and the signal behind each train turns red, so the next train waits until it has moved on.</p>

<p>Because stopping takes so long, a driver needs to know about a red signal well before reaching it. Many British main lines therefore use four-aspect signals, which give two signals’ warning:</p>

<ul>
  <li><strong>Red</strong>: the next section is occupied. Stop.</li>
  <li><strong>Single yellow</strong>: the next signal is red, so be ready to stop.</li>
  <li><strong>Double yellow</strong>: the next signal is a single yellow.</li>
  <li><strong>Green</strong>: clear for at least three sections.</li>
</ul>

<p>Behind each train is a trail of red, yellow, double yellow, then green.</p>

<p><img src="/blog/how-choo-works/aspects.svg" alt="Four signals behind a train: the one just behind it shows red, the one before that a single yellow, the one before that double yellow, and the one before that green." /></p>

<p>Signallers watch all this on a diagram of the track, with each train shown as a label in the section it’s in. The label is the train’s four-character “train reporting code” (more commonly called its <strong>headcode</strong>), such as <code>2U44</code>.</p>

<p>The labels are kept up to date by the <strong>train describer</strong> signalling system. It keeps a numbered slot for each section of line, called a <strong>berth</strong>, and stores the headcode of each train in each berth. When a train passes a signal and moves into the next section, the describer moves the train’s headcode on to the next berth.</p>

<h3 id="what-choo-gets-from-it">What Choo gets from it</h3>

<p>Network Rail publishes every one of those steps as open data, in its <strong><a href="https://wiki.openraildata.com/index.php/TD">TD feed</a></strong>, to the second. A message looks like this:</p>

<pre><code class="language-json">[{
  "CA_MSG": {
    "area_id": "D1",
    "from": "1758",
    "to": "1752",
    "descr": "2U44",
    "time": "1793186020000"
  }
}]
</code></pre>

<p>It says that in signalling area <code>D1</code>, train <code>2U44</code> has just moved from berth <code>1758</code> to berth <code>1752</code>.</p>

<p><img src="/blog/how-choo-works/signals.svg" alt="Signals divide the line into sections called berths. Train 2U44 has just passed the signal at the start of berth 1752, so its label moves from 1758 to 1752." /></p>

<p>You can watch it happen live on <a href="https://www.opentraintimes.com/maps">OpenTrainTimes</a>, which shows diagrams much like the signallers’ own from the same feed.</p>

<p><img src="/blog/how-choo-works/diagram.svg" alt="A signalling diagram of two lines through Tilehurst with a crossover: numbered signals, a berth box in each section, 2U44 in berth 1752 arriving at Tilehurst and 2U47 in berth 1761 on the other line, with occupied track lit red." /></p>

<h3 id="where-are-the-berths">Where are the berths?</h3>

<p>There’s a slight problem though. The message doesn’t say where berth <code>1752</code> is. A berth is just a number, and there’s no complete dataset of the berth locations. Volunteers on OpenStreetMap have mapped some of the signals, which Choo can match to berths, but coverage is far from complete.</p>

<p>But we do know where some of them are: Network Rail’s <strong><a href="https://wiki.openraildata.com/index.php/SMART">SMART</a></strong> data documents which berth steps mean a train has reached or left a timing point. So by using this lookup, Choo can see, in real time and to the second, when a train reaches or leaves most timing points.</p>

<p>Timing points can be many minutes apart. In between, the train describer still reports every step from berth to berth. We don’t know where those berths are, but it is still useful data: we can watch the data and record how long trains usually take to get from each berth to the next station.</p>

<p>Every time a train is sighted at a timing point, the Choo server looks back at the berths it entered over the previous ten minutes, and notes how long it took from each one (separately for stopping and non-stop trains). Over time, the server learns the typical patterns for the berths.</p>

<p><img src="/blog/how-choo-works/berth-times.svg" alt="Berths 1774, 1766, 1762, 1758 and 1752 lead to Tilehurst, each with a typical time from there to Tilehurst. A train moving into 1762 is expected at Tilehurst about 1 minute 15 seconds later." /></p>

<p>This lets us forecast when a train will pass its upcoming timing points.</p>

<h3 id="extra-checkpoints-for-fast-trains">Extra checkpoints for fast trains</h3>

<p>Remember the fast train with long gaps in its timetable, from Step 3? The signalling still sees it pass the stations in between, so Choo can use them as extra checkpoints.</p>

<p><img src="/blog/how-choo-works/extra-points.svg" alt="The fast train’s timetable has only Reading and Goring &amp; Streatley here, but the signalling sees it pass Tilehurst and Pangbourne, which become extra points." /></p>

<p>These timings also help Choo refine an approximation of where the signals sit along the track (with help from OpenStreetMap where volunteers have mapped them). That adjusts the speed model from Step 1 to match how trains really run, and in a train’s last few minutes, the countdown is timed from the last signal it passed before reaching you.</p>

<hr />

<h2 id="5-what-kind-of-train">5. What kind of train?</h2>

<p>Knowing when a train is coming is half the fun. The other half is knowing what it is. Using the <strong><a href="https://raildata.org.uk/">PTAC</a></strong> feed, Choo shows which units make up each train, with a photo from Wikipedia, its spotter nickname, the unit numbers and how many carriages it has.</p>

<h3 id="special-trains">Special trains</h3>

<p>The headcode from Step 4 also picks out the trains worth looking out for. Its first digit marks freight (<code>4</code>, <code>6</code>, <code>7</code> and <code>8</code>) and lone locomotives (<code>0</code>), and a <code>3</code> in autumn is usually a leaf-clearing train. A <code>Z</code> as the second character usually means a charter (sometimes a steam train!), and a <code>Q</code> a test train, such as the yellow ones that measure the track.</p>

<p>You can ask Choo to tell you when one is coming. The Choo server keeps watch over your saved spots and sends a notification before a special train passes, saying what it is and where it’s going, so you have time to get to your spot. I used this a couple of days after releasing Choo to see my first steam train passing under my local bridge!</p>

<hr />

<h2 id="credits-and-licences">Credits and licences</h2>

<p>Choo’s predictions are built from open data:</p>

<ul>
  <li><strong>Darwin</strong> (Push Port and timetable): National Rail Enquiries, via the <a href="https://raildata.org.uk/">Rail Data Marketplace</a>. <em>Powered by National Rail Enquiries.</em></li>
  <li><strong><a href="https://publicdatafeeds.networkrail.co.uk/">Network Rail’s open data</a></strong> <a href="https://wiki.openraildata.com/index.php/SCHEDULE">SCHEDULE</a>, <a href="https://wiki.openraildata.com/index.php/VSTP">VSTP</a>, <a href="https://wiki.openraildata.com/index.php/TRUST">TRUST</a>, <a href="https://wiki.openraildata.com/index.php/TD">TD</a>, <a href="https://wiki.openraildata.com/index.php/SMART">SMART</a> and <a href="https://wiki.openraildata.com/index.php/CORPUS">CORPUS</a>: contains information of Network Rail Infrastructure Limited, licensed under the <strong>Open Government Licence v3.0</strong>.</li>
  <li><strong><a href="https://www.data.gov.uk/dataset/ff93ffc1-6656-47d8-9155-85ea0b8f2251/naptan">NaPTAN</a></strong>: Department for Transport, <strong>Open Government Licence v3.0</strong>.</li>
  <li><strong><a href="https://wiki.openraildata.com/index.php/BPLAN">BPLAN</a></strong> and <strong>PTAC</strong>: via the <a href="https://raildata.org.uk/">Rail Data Marketplace</a>, under its terms.</li>
  <li><strong><a href="https://api-portal.tfl.gov.uk/">TfL Unified API</a></strong>: <em>Powered by TfL Open Data.</em> Contains OS data © Crown copyright and database rights 2016, and Geomni UK Map data © and database rights 2019.</li>
  <li><strong>OpenStreetMap</strong>: © OpenStreetMap contributors, under the <strong>Open Database Licence (ODbL)</strong>.</li>
  <li><strong>Wikipedia</strong>: train photos and text, each under its own licence (text under <strong>CC BY-SA 4.0</strong>).</li>
</ul>

<p>Thanks to the Open Rail Data community, whose <a href="https://wiki.openraildata.com/">wiki</a> is invaluable.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[If you’ve ever stood on a footbridge with a small child waiting for a train, you’ll know the experience of trying to figure out whether it’s worth waiting for the next one. Departure boards don’t help that much: they tell you when a train leaves a station, but maybe you’re not at a station. Maybe you’re on a bridge halfway between two, or on a footpath beside the line, or at the end of a platform where the fast trains run straight through.]]></summary></entry><entry><title type="html">Choo is here: never miss the next train past your bridge</title><link href="https://choo.express/blog/choo-is-here/" rel="alternate" type="text/html" title="Choo is here: never miss the next train past your bridge" /><published>2026-11-25T00:00:00+00:00</published><updated>2026-11-25T00:00:00+00:00</updated><id>https://choo.express/blog/choo-is-here</id><content type="html" xml:base="https://choo.express/blog/choo-is-here/"><![CDATA[<p>Hello, and welcome to the Choo blog. Choo is now on the <a href="https://apps.apple.com/gb/app/apple-store/id6828141748?pt=95943445&amp;ct=blog&amp;mt=8">App Store</a> for iPhone.</p>

<h2 id="why-i-made-it">Why I made it</h2>

<p>I have a toddler who loves watching trains. So we spend a lot of time on a footbridge that runs over our local rail line, waiting.</p>

<p>Once a train has passed, she immediately wants the next one (“more!”). Looking up departures or arrivals at the nearest station doesn’t fully answer the question: we’re not at the station, and half the trains that come past aren’t on any board at all: the fast ones that don’t stop, freight trains, and some other unusual ones. Sometimes we’d wait ten minutes for nothing; sometimes one would rush past while we were looking the other way.</p>

<p>So I built the thing I wanted: a countdown to the next train past the exact place we were standing.</p>

<h2 id="what-it-does">What it does</h2>

<p>Choo counts down to the next train past the place you’re watching from: a bridge, a footpath, the end of a platform. You choose the spot by dropping a pin on the map. Each spot’s pin then counts down to the next train past it, with an arrow showing which way it’s going, so you know where to look.</p>

<ul>
  <li><strong>Add your own spots.</strong> Long-press the map beside any railway, and Choo works out which line it is and which trains use it.</li>
  <li><strong>Trains Here.</strong> Standing by the line somewhere new? Choo shows a countdown for right where you are, with nothing to set up.</li>
  <li><strong>Every train, not just the ones that stop.</strong> Freight, test trains, charters, leaf-clearing trains and engines out on their own are all there. You can opt in to notifications for when a special train will be passing your spots, even with the app closed.</li>
  <li><strong>“What’s that one?”</strong> Tap any train to see its type, a picture, how many carriages it has, and its whole journey.</li>
  <li><strong>Waiting made easy.</strong> Follow a spot on your Lock Screen and in the Dynamic Island while you walk to the bridge, or put it on a Home Screen widget.</li>
</ul>

<p>It covers National Rail right across Great Britain, plus the Tube, DLR, Overground and Elizabeth line in London. No ads, no accounts, no tracking.</p>

<h2 id="the-clever-bit">The clever bit</h2>

<p>Nobody publishes exactly where every train is. What the railway does publish is its timetables, live reports of trains reaching and leaving places, and the signalling’s record of every train moving from one section of line to the next. Choo puts those together.</p>

<p>Choo’s server follows every train in Great Britain using National Rail’s feed, Network Rail’s timetables, movement reports and train describers (the signalling), and TfL’s data for the Tube. From the timetable it works out when each train should pass your spot, part-way between stations, using the shape of the track, the line’s speed limits and how fast that kind of train can go. Then it watches the real trains: it learns how long they take from each signal to the next station, and how long they stand at each platform. In the last few minutes before a train reaches you, the countdown comes straight from the signals, and runs to the second: <code>0:03</code>, <code>0:02</code>, <code>0:01</code>, “Now!”.</p>

<!-- If you’d like the full story, with diagrams of signals, berths and why a junction in Perthshire was once placed in London, read [How Choo predicts when a train will pass your bridge](/blog/how-choo-works/). -->

<h2 id="spotted-a-wrong-time">Spotted a wrong time?</h2>

<p>Choo is made by one person, and I’m limited on how many trains I can check! If you spot a timing that’s out, tell me from the app’s Report an Issue or the <a href="https://choo.express/support.html">support page</a>.</p>

<p>Now, off to find a bridge. Ready, steady… Choo!</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Hello, and welcome to the Choo blog. Choo is now on the App Store for iPhone.]]></summary></entry></feed>