ASP.NET Core 10 API and React client that visualize the canton of Thurgau's hourly traffic counts by vehicle class (data.tg.ch, CC0). - Background refresh from data.tg.ch every 6 h into a per-day JSON cache, so history grows beyond the source's two-week window - Road geometry per station direction from swisstopo swissTLM3D, oriented by geocoding the direction's target town; roundabout arms follow the road outward only - Leaflet map with canvas animation: dots drive along the road in both directions, density by hourly count, colour by vehicle class, right-hand traffic; play/pause, time slider and day selection - Station panel with per-class counts and Chart.js charts (hourly, weekday/weekend profile, daily totals, class mix) - swisstopo base map switcher (grey, colour, aerial) - Dockerfile and docker-compose with a data volume - xUnit tests for mapping, cache, geometry, geocoding and analysis Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.2 KiB
Markdown
24 lines
1.2 KiB
Markdown
# OpenDataVisualizer
|
|
|
|
Visualization for [opendata.swiss](https://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](https://opendata.swiss/de/dataset/verkehrszahldaten-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
|
|
|
|
```bash
|
|
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](CLAUDE.md).
|