Giter VIP home page Giter VIP logo

transitdata's Introduction

General

This system will read real-time data from various sources (for example, Pubtrans database regarding departures and arrivals) and convert those to GTFS real-time messages using a pipeline created with Apache Pulsar. The final step will publish the messages to different locations (such as MQTT brokers and blob storage).

General usage pattern is to build Docker images and then run them with docker-compose. Services are separated to different GitHub repositories, each containing the source code and the Dockerfile.

/bin-folder contains scripts to launch Docker images for Pulsar and Redis which are requirements for some of the services.

Requirements

Overall system requirements for running the system are:

  • Docker
  • Redis
  • Pulsar
  • Connection to a Pubtrans SQL Server database
  • Connection to an MQTT broker

System Architecture & Components

Transitdata

Alt text

Transitdata input

  • mqtt.hsl.fi vehicle positions in HFP format (all vehicles)
  • hsl-mqtt-lab-a.cinfra.fi estimates for stop time (metros)
  • Pubtrans ROI: estimates for stop time (bus and trams)
  • Pubtrans DOI: static data (schedule, stops, routes)
  • api.digitransit.fi/realtime/service-alerts/v1: not used
  • OMM DB: service alerts (cancellations, disruptions)
  • raildigitraffic2gtfsrt: train stop estimates (to be replaced by a service connected to ratadigitraffic)
  • sm5.rt.hsl.fi: EKE message from SM5 trains

Transitdata output

  • MQTT Broker cmqttdv.cinfra.fi: vehicle position in GTFS-RT format (HSL displays at stops)
  • Azure Blob storage: used for publishing vehicle position, trip updates and service alerts in GTFS-RT format (for Google Maps and 3rd-party applications) and for archiving messages (HFP and EKE) in CSV files
  • MQTT Broker pred.rt.hsl.fi -> Reittiopas.fi: stop estimates in GTFS-RT format
    • Note: this MQTT broker is intended to be used by HSL systems only. Its functionality can be changed without a notice and there is no guarantee that it will work for third-party applications.
  • Graylog server: logs from all the microservices.

Transitlog

Alt text

Components are stored in their own Github Repositories:

Common dependencies

Transitdata components

Sources
Processors
Publishers
Unused components
  • transitdata-hslalert-source reads trip cancellations from HSL public HTML API and generates TripUpdate cancellations. Not in use anymore.

Transitlog HFP components

Versioning

All the components in this project use semver, but the output conforms always to the GTFS Realtime standard. Some vendor-specific extensions might be added, which require incrementing the major version. Otherwise, new features should only increment the minor version, but some exceptions might arise. TripUpdate and ServiceAlert APIs are versioned independently.

Implementation notes

Pulsar seems to cause approximately 5ms of latency for each message, which is consistent with their promise. The latency is not a problem in itself, and is well within acceptable bounds. However, the latency means that a single-threaded consumer-producer loop can only process 200 messages per second.

transitdata's People

Contributors

paasovaara avatar hellej avatar mjaakko avatar kenkus-futurice avatar danieldunderfelt avatar haphut avatar akivaliaho avatar pierre-leonard avatar divinare avatar karppanenr avatar

Watchers

James Cloos avatar  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.