This project started in October 2019 in the Hackaton UPC 2019 (Initial devpost submission :)). It has also being part of final project for Software and Distributed Applications course of the Telecommunications Engineering Bachelor at the Polythecnical University of Catalonia (UPC).
- Sergio Giménez (@sergio-gimenez)
- Martí Riera (@martiriera)
- Benedetto Grillone (@Begri)
- Laura Lax (@LauLax)
- Bruno Ibáñez (@brunoibez)
- ieMaps: an inclusive eco-friendly app for mobility
- Table of contents
- Overview
- Run the project
- How does it work?
- Parameters calulation
ieMaps is an inclusive and eco-friendly Google Maps implementation. It uses the Google Maps API to perform all actions related to mobility. Google Maps is the quintessential web mapping service, but still, it does not care about the environment neither the people with reduced mobility (PWRM since now).
Knowing all the above, we decided to implement a third-party app that gives you a service like google maps but taking care of enviroment and people at the same time. We calculate the footprint of every trip shown in screen, so that the user knows what impact has for the planet to move around. We also calculate the cost of the trip, as well as the air pollution and forecast prediction of today and tomorrow.
We care about people with reduced mobility. We take care of the subway stations that are not propperly equipped properly for them to move around the station. If the preffered transport mode is by car, we show the nearest reserved parking spot for reduced mobility people.
By know, we take care of the following parameters in the city of Barcelona:
- Air quality
- Model that predicts the air quality of the following days
- Availability of electric vehicle chargers
- Carbon footprint calculation
- Car parking spots for PWRM
- Evaluation of the consumption of your vehicle
- Temperature
- Precipitation in real time and precipitation prediction
- Closest bike parking spot close to destination
- Price of taxis
Make sure you have a Google Maps API Key. To get it, go to the Google maps API page, sign-up and get a token to use. You must enter a credit card number to receive your token. However, Google claims they will not charge your account without you personally upgrading your service. Proceed at your own discretion.
To run the implementation, make sure you have installed Docker Engine and Docker-compose.
If not, check the following instructions:
To install docker check official installation guide for Windows, Mac or Linux.
For debian distros, fastest way is probably install from apt using the following commands:
Update software repositories
sudo apt-get update
Uninstall old versions of docker
sudo apt-get remove docker docker-engine docker.io
Install docker
sudo apt install docker.io
Start and automate docker. The Docker service needs to be setup to run at startup. To do so,type in each command followed by enter.
sudo systemctl start docker
sudo systemctl enable docker
IMPORTANT
Make sure you don't need to type sudo
every time you run docker. To do so, run the following command:
sudo usermod -aG docker $(whoami)
Reboot to apply this change.
For docker-compose, just run these commands:
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
In order to run the project in dockers, just run the deploy.sh
bash script located in the
root project folder. It will build and run two docker instances: ieMaps_react
and ieMaps_flask
.
Node server and Flask server can be runned locally by installing all the dependencies locally.
For run the node (react) server:
- Make sure you have
npm
installed and runnpm install
in/ieMaps_SAD/react/client-web
to install all needed dependencies. - Afterwards, run
npm start
in same directory in order ro run the server listening in port3000
For the flask (python) server:
-
Make sure you have
python3
andpip
installed. Install all needed dependencies by runningpip install requeriments.txt
inieMaps_SAD/app
directory. -
Afterwards run the server by running
python3 serverflask.py
. It will start flask server running on port5000
.
It consist of several python scripts that calculate the output parameters.
Finally, ieMaps.py
script merge all the information in a JSON file in order to
be sent.
Flask is a micro web framework written in Python. It listens in port 5000
for
a POST
method. If the POST
method is OK, it returns an OK 200
HTTP
response plus the JSON response prepared by the model.
React is a JavaScript library for building user interfaces. Is the responsible of creating the input form and sending it to the Flask API. Then it waits to the JSON response and prints the information from the JSON in a map and in the screen.
We have used a 'Exponential smoothing state space model' that predicts the weather for the following days.
We have implemented the model in R and used this forecast package for the Air Quality prediction.
Used API Forecasting Functions for Time Series and Linear Models
We have implemented a non-linear scale between one and three averaging the scaled values for each non-healthy emitted gas.
We have used a dataset given at Everis talk.
(Kg CO2 / l) * l/km * desplacement
We have taken information of PRM spots at this dataset: Typology of the reserved parking spots in the infrastructure network of the city of Barcelona .
We have taken information of PRM spots at this dataset.
We have used the Dark Sky API. It allows you to look up weather around the globe. Returning:
- Current weather condition
- Minute-byminute forecasts to one to one hour
We have used the Dark Sky API. It allows you to look up weather around the globe. Returning:
- Current weather condition
- Minute-byminute forecasts to one to one hour