On the train to BullHacks, we trying to come up with the idea of visualising trains in the real time using a 3D map.
What it does
The website takes real time data from various rail services to get the position of trains on their journey, and then uses that data to build a 3D map.
How we built it
We used TransportAPI to get real time information about trains, including their origin and destination, and how late they are running. We then used various APIs from Network Rail to get the full schedule information for the various trains so we could track them on their whole journey.
The visualisation was built using Three.JS to build a 3D world with stations and trains. The train postion is updated as they progress on their journey.
The whole project is then hosted on an AWS Lightsail VPS.
Challenges we ran into
We ran into many challenges in this project. First, it took a long time to decide how we would tackle the problem and the best techniques. We struggled to find the APIs we needed, since the Network Rail ones required manual account activation.
Our first attempt at the server side code was in Node.JS, which we soon found to be quite difficult to get working. After a few hours, we decided to abandon Node and switch to using Ruby with the Sinatra library.
Once our network rail account was approved (at 9PM!), we could get the data from them we needed. However, it turned out this was only available as a 2.5GB JSON file! Turning this into a database we could use took over an hour for it to import!