OpenDataVisualizer/docs/datasets/verkehrszaehlungen.md
Claudio Schaad 6a6b3a88c5 Add dataset docs, source credits and run script (#4)
- docs/datasets.md: overview of all sources with Mermaid diagrams, plus
  one page per dataset in docs/datasets/ (source, licence, fetch,
  refresh, cache, flowchart)
- CLAUDE.md: mandatory rule to keep the dataset docs up to date
- Map footers credit title, publisher and licence link of every source
  as required by CC BY 4.0, plus swisstopo and the processing applied
- run.ps1 builds the client and starts the server

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claudio Schaad <c.schaad@pog.ch>
Co-committed-by: Claudio Schaad <c.schaad@pog.ch>
2026-11-09 18:17:33 +00:00

37 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Verkehrszählungen
[← Übersicht](../datasets.md)
| | |
|---|---|
| Datensatz | stündliche Verkehrszählungen nach Fahrzeugklassen, `dbu-tba-1` |
| Quelle | [data.tg.ch/explore/dataset/dbu-tba-1](https://data.tg.ch/explore/dataset/dbu-tba-1/) |
| Herausgeber | Tiefbauamt Kanton Thurgau |
| Lizenz | CC0 1.0 |
| Inhalt | stündliche Zählungen an 64 Zählstellen, je zwei Richtungen, 10 Fahrzeugklassen (SWISS10) |
| Verwendet in | Karte `/verkehr/thurgau` |
| Abruf | JSON-Export `…/catalog/datasets/dbu-tba-1/exports/json?where=datum >= …` |
| Aktualisierung | Prüfung alle 15 min, Abruf alle 6 h (`Traffic:RefreshInterval`) |
| Cache | `{DataPath}/traffic/thurgau/stations.json`, `meta.json`, `counts/yyyy-MM-dd.json` |
| Code | `Schaad.OpenData.Traffic` (`ThurgauTrafficClient`, `TrafficRefresher`, `TrafficCacheStorage`) |
## Ablauf
```mermaid
flowchart LR
S["TrafficRefreshService<br/>alle 15 min"] --> R{"letzter Abruf<br/>älter als 6 h?"}
R -- nein --> W[warten]
R -- ja --> A["dbu-tba-1/exports/json<br/>where datum >= letzter Tag − 1"]
A --> B[ThurgauTrafficMapper]
B --> C["TrafficSnapshot.Merge<br/>neue Tage ersetzen, alte bleiben"]
C --> D[("counts/yyyy-MM-dd.json<br/>stations.json")]
C --> G["Strassengeometrie<br/>für neue Stationen"]
C --> E[TrafficDataStore]
```
## Hinweise
- data.tg.ch hält nur die letzten rund 14 Tage. Der Cache sammelt die Historie über dieses Fenster hinaus; wird er gelöscht, sind ältere Tage weg.
- Abgerufen wird ab dem letzten Cache-Tag minus einem Tag, damit ein zuvor unvollständiger Tag ersetzt wird.
- Die Strassenverläufe pro Richtung stammen aus einem eigenen Ablauf: [Strassengeometrie](strassengeometrie.md).
- Jahresarchive ab 2011 (`ogdtg.ch/verkehrsdaten/fahrzeugklassen/{jahr}_fzkl_data.csv.gz`) werden noch nicht importiert.