selfaware soup

Esther Weidauer

Flygskam

2022-11-02

World map with various flight paths drawn in red

I produced HOW MUCH CO2 by flying?!

3.7 equivalent tons over 42100km. That’s how much. 😰

Flight shame or flygskam is an anti-flying social movement, with the aim of reducing the environmental impact of aviation. Flight shame refers to an individual’s uneasiness over engaging in consumption that is energy-intense and climatically problematic. (Wikipedia)

I found this very handy R script here that estimates your carbon footprint from flying based on a list of itineraries.

It’s a little flaky and doesn’t accept the new Berlin airport BER but I swapped in the old SXF since it’s in the same geographic spot so the distances should match closely enough.

Looking at the full list like that, I’ve flown quite a lot for someone who didn’t have to travel much for work and much of it could very likely been avoided, especially several of the flights within Europe.

Here’s the full script that I ended up running:

library(tidyverse)
library(sf)
library(glue)
library(rnaturalearth)
library(units)
library(lwgeom)

# grams of carbon dioxide-equivalents per passenger kilometer
# https://en.wikipedia.org/wiki/Fuel_economy_in_aircraft
co2_eq <- set_units(88, g/km)

# countries map from Naturalearth
countries <- ne_countries(scale = "small", returnclass = "sf")

# airport code and coordinates to geolocate itineraries
airport <- read_csv("https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat",
                    col_names = c("airport",
                                  "name",
                                  "city",
                                  "country",
                                  "iata",
                                  "icao",
                                  "latitude",
                                  "longitude",
                                  "altitude",
                                  "timezone",
                                  "dst",
                                  "tz",
                                  "type",
                                  "source")) %>% 
  # Add Kai Tak, missig from the airport data
  add_row(iata = "HKGX",
          name = "Kai Tak", 
          city = "Hong Kong",
          latitude = 22.328611,
          longitude = 114.194167)

# itineraries
flight <- read_delim("from-to
SXF-FCO
FCO-SXF
TXL-YYZ
YYZ-YVR
YVR-YHM
YYZ-SXF
SXF-CPH
CPH-SXF
SXF-CPH
SXF-FAO
FAO-SXF
SXF-FAO
FAO-SXF
SXF-AGP
AGP-SXF
MUC-BER
BER-AGP
AGP-BER", delim = "-")

# geolocate
flight_geo <- flight %>% 
  left_join(airport, by = c("from" = "iata")) %>% 
  left_join(airport, by = c("to" = "iata"), suffix = c("_from", "_to"))

# create lines
flight_lines <- flight_geo %>% 
  mutate(line = glue("LINESTRING ({longitude_from} {latitude_from}, {longitude_to} {latitude_to})")) %>% 
  st_as_sf(wkt = "line", crs = "EPSG:4326")

# create great circles and compute costs
flight_geo_gc <- flight_lines %>% 
  st_segmentize(set_units(100, km)) %>% 
  mutate(distance = set_units(st_length(line), km),
         co2 = set_units(distance * co2_eq, t))

# totals
total_flight <- flight_geo_gc %>% 
  st_drop_geometry() %>% 
  summarise(total_distance = sum(distance, na.rm = TRUE),
            total_co2 = sum(co2, na.rm = TRUE))

# map
ggplot() +
  geom_sf(data = countries, fill = "lightgrey", color = "lightgrey") +
  geom_sf(data = flight_geo_gc, color = "red") + 
  # geom_sf(data = flight_lines, color = "blue") + 
  labs(title = "My air travel carbon footprint 2005-2022",
       subtitle = glue("{round(total_flight$total_distance, -2)} km - {round(total_flight$total_co2, 1)} teqCO2")) +
  theme_minimal()