- Thurgau hourly traffic counts (data.tg.ch) refreshed every 6 h into a per-day JSON cache - Road geometry per station direction from swisstopo swissTLM3D; roundabout arms run outward from the roundabout centre - Leaflet map with animated vehicles by class, time controls and base map switcher (grey, colour, aerial) - Station panel with per-class counts and Chart.js charts - Start page with map tiles; traffic map at /verkehr/thurgau - Dockerfile and docker-compose, xUnit tests 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>
31 lines
1 KiB
C#
31 lines
1 KiB
C#
namespace Schaad.OpenData.Traffic.Models;
|
|
|
|
public readonly record struct VehicleCounts(
|
|
int Bus,
|
|
int Motorcycle,
|
|
int Car,
|
|
int CarWithTrailer,
|
|
int Van,
|
|
int VanWithTrailer,
|
|
int VanWithSemiTrailer,
|
|
int Truck,
|
|
int TruckWithTrailer,
|
|
int SemiTrailerTruck)
|
|
{
|
|
public int Total => Bus + Motorcycle + Car + CarWithTrailer + Van + VanWithTrailer + VanWithSemiTrailer + Truck + TruckWithTrailer + SemiTrailerTruck;
|
|
|
|
public int[] ToArray() =>
|
|
[Bus, Motorcycle, Car, CarWithTrailer, Van, VanWithTrailer, VanWithSemiTrailer, Truck, TruckWithTrailer, SemiTrailerTruck];
|
|
|
|
public static VehicleCounts operator +(VehicleCounts a, VehicleCounts b) => new(
|
|
a.Bus + b.Bus,
|
|
a.Motorcycle + b.Motorcycle,
|
|
a.Car + b.Car,
|
|
a.CarWithTrailer + b.CarWithTrailer,
|
|
a.Van + b.Van,
|
|
a.VanWithTrailer + b.VanWithTrailer,
|
|
a.VanWithSemiTrailer + b.VanWithSemiTrailer,
|
|
a.Truck + b.Truck,
|
|
a.TruckWithTrailer + b.TruckWithTrailer,
|
|
a.SemiTrailerTruck + b.SemiTrailerTruck);
|
|
}
|