GO Transit Dashboard

Introduction

Metrolinx miraculously approved my request for a key for their open API, so I thought it would be fun to build a live dashboard to track the positions of their vehicles across Ontario. Unfortunately, I shut down the dashboard because the amount of data constantly being written to my home server would wear out the drives faster than I would like.

alt text

Software

  • Grafana Cloud to build and host the dashboard. The "Geomap" panel was used to display the map on the dashboard.
  • Local PostgreSQL database to store data

db-image

  • Python to handle communication between the Metrolinx API and the Postgres database

How it works

  • A Python script uses httpx to get data from Metrolinx using their API.
  • The response from the request is parsed and relevant information is stored in the Postgres database.
  • This backend process is run as a systemd service in an isolated container on my home server to pull and process data 24/7.
  • SQL queries were written in Grafana Cloud to pull specific data from the locally-hosted database to be displayed on the dashboard.

Limitations

Unfortunately, Grafana is only meant to display data. It does not support functionality for user interactions such as filtering or hiding information.