Flight Patterns in Canada
Updated: June 5, 2020

INTRO. Every flight is different. There can be differences in routes, airways, velocity, runways, etc. Here we try to look at how different flights and routes are in Canada. Data is domestic passenger flights of popular routes in Canada. All flights that departed and arrived between February 17, 2020 12:00:00 AM GMT and February 17, 2020 11:59:59 PM GMT. All routes with more than four flights that day.

AIRPORT DATA. Airport coordinates and size were pulled from OurAirports [1]. With the list of large airports in Canada, we fetch arrivals by airport using OpenSky Network's API [2]. We want to focus on domestic flights, so we remove international flights.

Daily dumps of flight track data are in GMT, so we pull only flights that arrived between Monday, February 17, 2020 12:00:00 AM GMT and Monday, February 17, 2020 11:59:59 PM GMT. We count the number of flights per airport and sort by quantity, and now we have a proxy of popularity.

FLIGHT TRACK DATA. We downloaded raw logs of daily flights from OpenSky Network's datasets [3]. For 24 hours, it is 9.5GB of data... A considerate size, but not too large as to need big data tools. After some cleansing is more manageable - rows with latitud, longitude or callsigns with NAs or nulls were removed.

For visual reasons and to not skew our estimations, flights that did not reach its destination (~15km around airport's coordinates) for the period selected, were not considered.

METHODOLOGY. To calculate average flight of route, first we filter out the rows where the plane is on ground. Every flight has different number of observations, so we need to normalize the number of observations before any calculation. We make some transformations and then estimate the expected flight.

STACK. Data analysis was done on Python with pandas. Since this was a one-off with a small static dataset, there was no need to set up a database. On the frontend, vanilla JS with Mapbox GL JS, Mapbox plugin arc.js to display great circle line, and Material Components Web for components, style and animations.

THANKS. Dario Saveliovsky and Matt Smith for their valuable feedback, and OpenSky Network for their data and support.

You can email me if you want to give feedback

Thank you,

[1] https://ourairports.com/data/
[2] https://opensky-network.org/apidoc/
[3] https://opensky-network.org/datasets/states/