Git Product home page Git Product logo

hvv_live_karte's Introduction

HVV Live Karte mit Verspätungen

Mit Hilfe der kostenlosen HVV API können mit diesem Projekt die Fahrten und Verspätungen der HVV Live in Hamburg auf einer Karte projiziert werden, um mögliche Einflüsse von Ereignissen (z.B. Wetter, Fußballspiele, Dom, etc.) zu analysieren. Dabei wird automatisch eine Heatmap der bereits gespeicherten Ereignisse erzeugt.

Note

Das Projekt ist im Rahmen des Moduls "Datenmanagement und Algorithmen für Big Data" im Studiengang "Master Informatik" der HAW Hamburg entstanden und hat nichts mit der HVV zu tun.

Demo (Bild)

Installation

Zunächsten sollten Einstellungen als Umgebungsvariablen in der sample.env gesetzt werden. Im Anschluss wird diese in .env umbenannt. Dann sollten alle Dependencies installiert werden:

pip install -r requirements.txt

Kubernetes

1) Komponenten deployen:

cd ./deployment/k8s/kafka
kubectl apply -f 01-zookeeper-deployment.yaml
kubectl apply -f 02-broker-deployment.yaml
cd ../mongo
kubectl apply -k .

2) Portforward für die Kubernetes Dienste:

kubectl port-forward <POD-NAME-DES-BROKERS> 9092

Important

  • IP Adresse des Zookeepers (kubectl get services) muss in der 02-broker-deployment.yaml in der jeweiligen Zeile ergänzen
  • In der /etc/hosts muss folgende Zeile ergänzt werden: 127.0.0.1 kafka-broker

Docker

Requriements:

  • Docker
  • Docker-Compose

1) Mongo Container starten

cd ./deployments/docker/
docker-compose -f mongo.yml up -d

2) Kafka Container starten

docker-compose -f kafka.yml up -d

Oberfläche starten

1) Start des Servers:

python server.py und 🔗 Frontend starten

2) Luigi Frontend starten:

luigid --logdir tmp

Luigi ETL manuell starten (--local-scheduler wenn ohne Frontend):

python -m luigi --module src.etl.propagate propagate [--local-scheduler]

Oder als Cronjob alle x Sekunden automatisiert:

chmod +x run_luigi.sh
./run_luigi.sh -t <SECONDS>

Lambda-Architektur

Technologien

  • Streaming Komponenten:
    PySpark, Kafka
  • Datenbanksystem:
    MongoDB, da JSON
  • ETL Pipeline:
    Luigi von Spotify
  • Entwicklungsumgebung:
    Java, Python

JSON-Zielformat

Die Ursprungs JSON-Struktur ist zu groß und nicht notwendig, wird daher unkonventiert. Eine Datei pro eindeutigen Objekt mit ID:

Schlüssel: -origin:key-destination:key-.json, bsp.: X35-90010-90011-1668513180

{
    "_id": "X35-90010-90011-1668513180",
    "line": "X35",
    "vehicleType": "REGIONALBUS",
    "timestamp": 1668513240,
    "startDateTime": 1668513180,
    "endDateTime": 1668513300,
    "startStationName": "Ahrensburg, Meisenweg",
    "endStationName": "Ahrensburg, Teichstraße",
    "tracks": {
        "start": [34.232, 54.232],
        "end": [35.232, 55.232],
        "course": [35.232, 55.232]
    },
    "realtimeDelay": 0,
    "destination": "UK Eppendorf",
    "origin": "Sorenkoppel"
}

Quellen

hvv_live_karte's People

Contributors

bitnulleins avatar

Watchers

 avatar

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.