How to Quantify the Impact of COVID-19 Measures on Urban Density? A data-driven approach with Python and REST APIs

Rail vs. Airline

  • We define the density variation for a given day as the percentage of variation with respect to the baseline. We define the baseline as the median density, for the corresponding day of the week, during the month of January 2020.
Density evolution for the postal code 8001 associated with the train station of Zurich
Density evolution for the postal code 1215 associated with Geneva airport
  • We observe an important decrease in density just after the federal measures of March 13 with a maximum decrease of ~80% for the train station of Zurich and of more than 90% for Geneva airport.
  • In the weeks following the measures, the density progressively increased but is still far from its usual level (~-25% for Zurich train station in August vs. ~-50% for Geneva airport for the same month).
  • This also confirms that the impact of the pandemic is more important on the airline industry than on the rail industry. Naturally, in order to measure more accurately this trend, we would need to run the same analysis for all train stations and all airports of Switzerland.

How to produce these plots for any region in Switzerland?

  • [Easiest] Start with this code that allows for getting the hourly density evolution for any postal code.
  • Modify the code below in order to focus your analysis of density evolution on the 24 hours associated with the available day (27 Jan. 2020).
The connection to the API is straighforward and is done with a few lines of code. The client_id and client_secret are obtained once you register to the heatmaps API



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store