Live at: https://carbonfootprince.com
A carbon emissions calculator website that uses your Google location history to give you detailed insights into the impact your personal transporation has on the environment. Everything can be run offline (client-side analysis).
I hope you'll jump in and improve this site! It's pure HTML, CSS, and (vanilla) Javascript!
git clone
the repositorycd carbon-foot-prince
python -m http.server 8080
(run a web server from that directory)- Open
http://localhost:8080/
in your browser.
Google location history export files include series of activity segments, data objects that describe one particular movement (e.g. your drive to the grocery store). Each of these activity segments includes the start time and location, end time and location, distance of travel (meters), and most likely mode of transportation. The modes include, but may not be limited to:
IN_PASSENGER_VEHICLE, CYCLING, WALKING, IN_BUS, HIKING, MOTORCYCLING, IN_TRAM, RUNNING, FLYING, STILL, IN_FERRY, IN_TRAIN, SAILING, SKIING, IN_SUBWAY, IN_VEHICLE, UNKNOWN_ACTIVITY_TYPE
Personal emissions are calculated using the following function: e = cd
, where
e
= emissions of CO2 (kgCO2)c
= emissions factor (kgCO2/kmpassenger)d
= distance (km)
and c
varies according to the activity type. The various functions used to determine personal emissions are defined in getActivityEmissions(distance, activity)
.
Source:
UK Department for Business, Energy, and Industrial Strategy - 2019 Government greenhouse gas conversion factors for company reporting
Sources:
USA EPA (Light-Duty Vehicles, Motorcycles, Buses, Commercial Aviation, & Rail)
- https://www.epa.gov/greenvehicles/fast-facts-transportation-greenhouse-gas-emissions
- https://www.epa.gov/greenvehicles/archives-fast-facts-us-transportation-sector-greenhouse-gas-emissions
Rhodium Group (2020 estimates)
Macrotrends (USA population)
https://www.macrotrends.net/countries/USA/united-states/population
Based off a 4.52% reduction of your emissions every year after 2015 until 2030, this projects that annual reduction onto the average American's personal transportation emissions prior to 2015. To be specific, this looks at the average emissions during the period 2010 to 2015.
Your yearly 2015 Paris Climate Accords goal is defined by getAnnualBudgetAllowance(reductionPercentageGoal, currentYear, annualEmissionsAverage)
.
Assume that the average American emitted an average of 6 kgtCO2 per year between 2010 and 2015, and in order to reach an annual emission of 3 kgtCO2 by 2030, they would need to cut 4.52% each year.
For 2016, the calculation would look like this: 6 * (1 - 0.0452)2 = 5.46985824, where the exponent (2) is defined by the nth year since then end of 2014.
International Energy Agency (Passenger road vehicles, Aviation, Rail)
Carbon Brief (2020 estimates)
Worldometers (world population)
If you've thought of a new feature or found a bug undocumented feature, either open a pull request, or, if you aren't a coder, create an issue in this repository.
.
├── LICENSE
├── README.md
├── images/
├── index.css
├── index.html
├── index.js
├── lib/ (zip.js files)
└── styles/
├── desktop
└── mobile
- Google Charts, for visualizing data
- leaflet.js, for rendering the interactive map
- leaflet.heat, for rendering the heatmap overlay
- zip.js, for unzipping the location export file
Thanks to the following authors of flaticon.com's SVG repository:
- free-icon
- pixel-perfect
- good-ware
- mynamepong
- adib-sulthon
- xnimrodx
- eucalyp
- pongsakornred
- smashicons
- dinosoftlabs
- freepik
Your location data never leaves your computer. Once you import the zip file into this window, the program that was downloaded into your browser when you loaded this webpage starts the analysis; nothing about your location data leaves. The webpage does send usage data, such as clicks, upload durations, etc. to Google Analytics.