Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Follow publication

Member-only story

Visualize the German Railway System with Kepler.gl

Sixing Huang
Geek Culture
Published in
7 min readNov 10, 2022
Figure 1. All German train stations in 2020 and the planned route between Braunschweig and Munich in Kepler.gl. Image by author.

Back in the day, the young German railway was organized more like a military than a transport company. Trains were punctual and workers were disciplined. Nowadays, it is a national sport to mock the Deutsche Bahn (DB). Delays are frequent and cancelations are often. This stark contrast is no surprise because the German railway system has become more complex. And it is hard to operate such a vast and intricate network without some hiccups.

It is difficult to appreciate this complex system without some good visualizations. You can see the vein-like railway network in the GeoViewer by Deutsche Bahn itself. But I would like to do some flight paths such as this one for the German railway. In this case, I turn to Kepler.gl.

In my previous article Level up Google Earth Engine with Kepler.gl, I have demonstrated how to generate beautiful maps with this free, WebGL-empowered library. These maps are not only esthetically pleasing, but they also help us to better understand the world.

In this article, I would like to create three maps for the Deutsche Bahn: the train stations, the optimal route between two stations, and all the stations that lead directly from and to Berlin (no transit). Instead of the online tool, I will use the Python API by Kepler.gl so that I can process the data and make the maps in just one Jupyter notebook. This project relies on data from the Deutsche Bahn. One caveat: you need to have some basic German to understand the documentation and the API variables, though. But don’t worry, I will walk you through the whole process. The code for this tutorial is hosted on my GitHub repository here.

1. Train stations of 2020

The train station data for 2020 can be downloaded directly from a link on the Deutsche Bahn website. Curiously, the data does not contain any coordinates. Luckily, we can get this information from the Deutsche Bahn API.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Sixing Huang
Sixing Huang

Written by Sixing Huang

A Neo4j Ninja, German bioinformatician in Gemini Data. I like to try things: Cloud, ML, satellite imagery, Japanese, plants, and travel the world.

Responses (1)

Write a response