GIS: Advanced Route Planning of Electric Vehicles based on Charging Stations

A project for GIS lecture, Uni Konstanz, winter term 2020/2021.

This is a GIS application that supports the exploration of Electric Vehicles (EV) charging stations in Germany. The EV charging stations are rated by surrounding facilities.

Motivation

  • EV is becoming popular.
  • The time for charging an EV is significantly longer than refueling a normal car.
  • Thus, drivers might need to spend some time around, e.g., a cup of coffee in a Café. (No alcohol!)

Datasets

NOTE: We provide preprocessed data to minimize setup time (see setup section). Nevertheless, if you have time and a good machine you can import the OSM data by yourself and perform the necessary preprocessing by yourself. Therefore, OSM data must be manually loaded on the database. You can use osm2pgsql to perform this operation. On Windows

.\osm2pgsql.exe --database gis_db --host localhost --port 25432 --username gis_user --password --create --slim --drop --latlong --hstore-all germany-latest.osm.pbf

Afterwards, execute the SQL script from here in your database.

Systems

  • Database: PostgreSQL with extension PostGIS
  • Backend: Python + Flask
  • Frontend: TypeScript + Angular

Architecture is wrapped in a Docker Container.

Setup

The following section describes the process of setting up the system from scratch. Read the following very carefully and execute each of the necessary steps.

Prerequisites

NOTE: Running this system requires at least 7GB of RAM.

Installation

  • Clone this repository locally.

  • Extract the ors.zip file (you downloaded in the previous steps) in the ./ors directory in the root folder of the cloned project. The ./ors directory should now include 4 folders and one .pbf file.

  • Run docker-compose build in the project's root folder to build the images.

  • Run docker-compose up database to start database container to import data.

  • Now, connect to the database (should be on localhost:25432) started before. To do so, follow the guide for DBeaver: https://dbeaver.com/docs/wiki/Connect-to-Database/. Database information:

    ENV POSTGRES_DBNAME="gis_db"

    ENV POSTGRES_USER="gis_user"

    ENV POSTGRES_PASS="gis_pass"

  • Then, use the downloaded SQL dump dump-gis_db.sql and import it in our database. You may follow the instructions provided here: https://dbeaver.io/forum/viewtopic.php?f=2&t=895.

  • After importing the SQL dump, everything should be ready and you can stop the database container. Further checks and startup information can be found below.

Startup

  • Start the docker containers with the following command
docker-compose up
  • For first startup:
    • After all the containers are started (around 3 minutes for the first time), the OpenRouteService has to read the correct configuration file.
    • Stop the container and all services after full startup.
    • Run docker-compose up again to start the container.

Wait some time for the initializaton (around 1-3 minutes).

Report

The report of the project can be found here.

Troubleshooting

If you have problem installing or setting up something, don't hesitate to contact us (firstname.lastname@uni-konstanz.de).