Coder Social home page Coder Social logo

xavb64 / lowtrip Goto Github PK

View Code? Open in Web Editor NEW
54.0 2.0 5.0 13 MB

A web app to compute travel CO2eq for different means of transport worldwide

Home Page: https://lowtrip.fr

License: GNU Affero General Public License v3.0

HTML 1.22% Python 33.84% JavaScript 0.21% TypeScript 64.39% Dockerfile 0.34%
carbon-footprint energy map slow-travelers travel

lowtrip's Introduction

lowtrip

a web app to compute travel CO2eq for different means of transport worldwide

The work presented here is independent and not-for-profit. This work has been carried out on a voluntary basis.

The aim of this web app is to present precise carbon inventories per passenger for each mode of transport and each journey. These results enable users to make informed choices in the context of reducing their greenhouse gas emissions to mitigate climate change. To put these results into context, total net yearly per-capita emissions should not exceed 2 tons CO2eq in 2050 to limit global warming below +2°C.

You can have a look at https://lowtrip.fr/.

How the emissions are calculated?

To calculate CO2 equivalent emissions per person, we multiply the distance of a journey (km) by the corresponding emission factor (mass of CO2 equivalent per person per km) of a mean of transport. For a mutlistep journey, these emissions are summed over the different steps:

$$CO_2eq = \sum_{step} Distance(km) \times Emission \: Factor(kgCO_2eq / km) $$

Estimation of distances

Mean of Transport Distance
Train OpenStreetMap network
Car & Bus & eCar OpenStreetMap network
Bike route OpenStreetMap network
Plane Geodesic distance and average detour
Ferry & Sailboat Approximation of shortest path

What do emission factors depend on?

Mean of Transport Variable
Train Visited countries
Bus -
Car Number of passengers
Electric car Visited countries & Number of passengers
Bike route -
Plane Distance of journey
Ferry User-specified parameters
Sailboat - ; improvements on the way

Emissions factors consider usage (linked to the manufacture and use of energy to move the vehicle) as well as infrastructure and vehicle construction where these are significant. The table below summarizes the types of emissions taken into account by lowtrip. Empty cells mean that the related emissions did not contribute significantly to the result and are therefore excluded to facilitate understanding and readability for the user.

Mean of Transport Usage Vehicle construction Infrastruture construction
Train
Car & Bus & eCar
Bike route Not found
Plane
Ferry Not found
Sailboat Not found

All assumptions, data and sources used are available in the methodology document.

How to launch the app?

Prerequisites

Have docker installed

Launch the app

At the root of the directory, run:

docker-compose up --build

You can now connect to http://localhost:3000 to test the application.

Note: If you want to launch them in the backgroup and leave them running, you can add the flag -d or --detach.

Rebuild and restart a service

At the root of the directory, run:

docker-compose up --build <service name: backend or frontend>

Stop the app

At the root of the directory, run:

docker-compose down

How to launch the app components separately?

Prerequisites

Have python & node installed

Launch the backend

cd backend

# create a python environment and activate it
python -m venv lowtrip-venv
source lowtrip-venv/bin/activate

# install the dependencies
pip install -r requirements.txt

# launch the app
gunicorn app:app

You can format the code with ruff:

pip install ruff
ruff format

Launch the frontend

cd frontend

# install the dependencies
npm install

# launch the app
npm start

How to cite this work ?

Bonnemaizon, Xavier, Ni, Clara, Gres, Paola & Pellas, Chiara. lowtrip (2024). https://lowtrip.fr

lowtrip's People

Contributors

baudouinh avatar clarani avatar lerri-cofannos avatar mikaelarguedas avatar paolagres avatar quentinms avatar xavb64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lowtrip's Issues

Computing hallucinations for impossible trips

Issue reported by message

Description:

In the "comparisons with other modes of transport," sometimes the algorithm attempts to produce a value that may simply not exist. For example, a journey obscure enough that there might not be a train route: Kiruna (Sweden) to Reine (Norway). Yet, the map produces a value for the train (and even a line that goes completely off track). It is still needed to verify if this also happens with airports. I believe there are few airports in the Lofoten area of Norway, where this could happen.

Steps to Reproduce:

Select Kiruna (Sweden) as the origin and Reine (Norway) as the destination.
Observe the value and route suggested for the train.
Expected Behavior:
The algorithm should recognise when there is no viable train route and provide appropriate feedback or alternative suggestions.

Look for the closest airport when using plane

Hello there !

As the lookup already exists for train station, it could be relevant to search for the closest airport of the user provided location (with OSM POI for example).

I've been working on a similar tool on my side, hightly motivated by volonteering for POW France (available on https://protectourwinters.fr/outil-co2e/ and code on https://github.com/tomasbastien/co2e-calculator), I'll be sharing common concerns that I encountered in separated issues in this repo

Stick as much as possible to roads and tracks

Hello there !

No sure if it's a major concern, but it looks like paths are optimized to lower total of segments (reduce computing time ?). It could result on imprecision on the kilometers total used in the co2e calculation.

I've been working on a similar tool on my side, hightly motivated by volonteering for POW France (available on https://protectourwinters.fr/outil-co2e/ and code on https://github.com/tomasbastien/co2e-calculator), I'll be sharing common concerns that I encountered in separated issues in this repo

Migrate the mail sender to the backend

Description

The mail sender should be in the backend for more security:

  • add a new endpoint to send the mail from the backend
  • in the frontend, call the new endpoint to send the mail

Some cities can not be found

Users reported that the following cities can not be found:

  • Les Sable d'Olonne, France
  • Dover, Great-Britain
  • Svenborg, Danemark
  • Istanbul and Ankara, Turkey

Incomplete ferry methodology

Issue reported via personal message

Description:

In the methodology section, I noticed that the ferry option does not take into account parameters related to the number of passengers or infrastructure. This is unfortunate because ferries are often significant emitters (in the North, there are hardly any eco-friendly ferry options, mostly cruise ferries with bars and supermarkets for 24-hour journeys like Stockholm-Helsinki). It seems that the brand Bon Pote has addressed this issue in their own methodology; we should look into it.

Missing cookies manager to be RGPD compliant

/label Enhancement

I noticed the use of Google Analytics cookies on the website. To be RGPD compliant you'll need to add a cookie manager in order to give the user the possibility to reject usage of cookies, or at least not deposit the cookie by default on the browser before explicit consent of the user.

Add docker setup

Description

Add a docker-compose config to help new comers to easily deploy locally lowtrip.

Feature Request: Shareable link to results

I'd love to be able to share a direct link to the results.

Here's my use case: I'm writing a blog post about going from Paris to Lisbon (via Barcelona and Madrid) and comparing it to the impact of flying. I'd love to be able to link to the page that compares both trips directly, so people don't have to reenter the details when they go on lowtrip.fr.

Use ADEME API for updated co2e values

Hello there !

ADEME org now provides API to query multiples entries from their database, including km to co2e conversion. You can freely ask for an API key (Bearer Auth) to use it at [email protected], more details on : https://impactco2.fr/api-doc

It could replace local values that are actually used in this tool.

I've been working on a similar tool on my side, hightly motivated by volonteering for POW France (available on https://protectourwinters.fr/outil-co2e/ and code on https://github.com/tomasbastien/co2e-calculator), I'll be sharing common concerns that I encountered in separated issues in this repo

Feature idea : ADEME CO2 Detector

Pour faire prendre conscience des ordres de grandeur, on pourrait ajouter la balise de Impact CO2 https://impactco2.fr/detecteur-co2 qui permet de visualiser des équivalents en termes d’émissions carbone.

Par exemple sur la page méthodo (même si le + intéressant serait sur la comparaison des voyages)

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.