About

Flight Patterns in Canada
Updated: March 2, 2020

INTRO. To estimate air travel GHG emissions, it is common to calculate distance travelled using great circle distance. Great circle distance, in short, is a straight line connecting two points on Earth. Here, you can see that flights do not follow a straight line, but it is more like a curvature. Using a straight line is a lazy approach and we may be under estimating emissions.

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 Anna Nguyen for their valuable feedback and support.

You can email me if you want to give feedback

Thank you,
Pedro

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