Visualization for opendata.swiss
Find a file
Claudio Schaad 8de869b023 Fix roundabout arm geometry for untargetable directions
Stations like "WEINFELDEN Kreisel West - Umfahrung" have directions
such as "zur Umfahrung" or "von Egelseestrasse" that cannot be
geocoded, so their dots were drawn on a nearby side road or around
the roundabout ring.

- Derive the roundabout centre from all stations sharing the name
  before " - " and point each arm outward from it
- Prefer road segments named like the station's address when
  following an arm; reject arms that don't get away from the centre
- Parse "zur", "zum", "Richtung" and "vom" direction prefixes
- Treat only swissTLM3D object kinds 12-19 as non-roads; kind 20 is
  a regular road (e.g. Dunantstrasse in Weinfelden)
- Bump the geometry cache to v7 so all stations are rebuilt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 20:50:48 +01:00
.claude Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
client Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
Schaad.OpenData.Server Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
Schaad.OpenData.Tests Fix roundabout arm geometry for untargetable directions 2026-11-06 20:50:48 +01:00
Schaad.OpenData.Traffic Fix roundabout arm geometry for untargetable directions 2026-11-06 20:50:48 +01:00
.dockerignore Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
.gitignore Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
CLAUDE.md Fix roundabout arm geometry for untargetable directions 2026-11-06 20:50:48 +01:00
Directory.Build.props Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
Directory.Packages.props Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
docker-compose.yml Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
Dockerfile Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
LICENSE Initial commit 2026-11-06 18:41:39 +00:00
OpenDataVisualizer.sln Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00
README.md Add Thurgau traffic visualizer with animated map 2026-11-06 20:33:58 +01:00

OpenDataVisualizer

Visualization for opendata.swiss.

Traffic in the canton of Thurgau

The first visualization shows the hourly traffic counts of the canton of Thurgau (Verkehrszähldaten motorisierter Individualverkehr nach Fahrzeugklassen, CC0):

  • animated map: vehicles drive along the real road in both directions of each counting station, the dot density follows the hourly count and the colour the vehicle class
  • time controls to play through a day or jump to any hour
  • station panel with the counts per vehicle class, hourly values, average weekday/weekend profile, daily totals and class distribution

Road geometry comes from swisstopo (swissTLM3D), the base map from swisstopo as well.

Run

docker compose up --build

Then open http://localhost:8080. On the first start the app downloads the data from data.tg.ch and builds the road geometry (one to two minutes); it is cached in the opendatavisualizer-data volume and refreshed every six hours. Since data.tg.ch only serves the last two weeks, the cache keeps growing over time.

For development see CLAUDE.md.