Demo: @SDT_Navigator_bot
This project is developed in C++ and Python and has been primarily tested on Linux. For optimal compatibility and performance, we recommend using a Linux environment. The following instructions are specifically tailored for Linux systems:
- Install Python 3.11 or newer version
- Install CMake (e.g.
sudo apt install cmake
for Ubuntu) - Install Qt 6 (e.g.
sudo apt install qt6-base-dev
for Ubuntu) - Install Python packages by running
pip install -r scripts/requirements.txt
in the project's root directory
Ready-to-use commands for Ubuntu
sudo apt update
sudo apt install python3 python3-pip cmake qt6-base-dev
pip install -r scripts/requirements.txt
Our project relies on the public transit data in the GTFS format. For development purposes, some historical GTFS data can be obtained from transitfeeds.com or mobilitydatabase.org.
GTFS in zip
-archived format should be placed in the data/raw
directory.
We can also precompile our main program:
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build --parallel
Running the project consists of three steps:
-
First we need to prepare the data:
python3 scripts/convert.py
-
We can now choose a city from the
data
folder and run the program. For example, let's choose Hamburg (GTFS folder:data/gtfs_hamburg
):./build/sdt-navigator gtfs_hamburg
-
When the application is loaded, we can search for routes between two stops. For example, let's find a route between the "Bremen Hbf" and "Hamburg Airport (Flughafen)":
$ ./build/sdt-navigator gtfs_hamburg Loading transport system from directory "gtfs_hamburg"... Transport system loaded [SDT Navigator]$ route --start "Bremen Hbf" --end "Hamburg Airport (Flughafen)" --date 2020-03-20 --time 06:00 Journey from Bremen Hbf to Hamburg Airport (Flughafen) Fri Mar 20 06:26:00 2020 - Fri Mar 20 08:09:00 2020 RAIL RE4 Bremen Hbf -> Hamburg-Harburg Fri Mar 20 06:26:00 2020 — Fri Mar 20 07:29:00 2020 RAIL RE3 Hamburg-Harburg -> Hamburg Hbf Fri Mar 20 07:31:00 2020 — Fri Mar 20 07:41:00 2020 SUBURBANRAILWAY S1 Hamburg Hbf -> Hamburg Airport (Flughafen) Fri Mar 20 07:44:00 2020 — Fri Mar 20 08:09:00 2020
To run the Telegram bot, you need to create a .token
file in the scripts
folder and put your Telegram bot token there.
After that, you can run the bot:
python3 scripts/bot.py
Tests are automatically run by GitHub Actions. To run them locally:
-
Prepare the data as shown above:
python3 scripts/convert.py
-
Run the tests:
ctest --test-dir build -V --output-on-failure
This project is distributed under the terms of the GPL-3.0 License
Please note that this is a research-focused project and is not yet intended for production use