New Schaad.OpenData.Watercraft library that discovers the yearly "immatrikulierte Wasserfahrzeuge" datasets (2021–2025) on data.tg.ch, caches them and aggregates boats per harbour location by type, propulsion, fuel, emission group and use, with length/power bins. API under /api/watercraft, new page /schifffahrt/thurgau with donut markers per location, year playback, toggleable categories and a location/canton panel. Swisstopo base layers moved to map/baseLayers.ts for both maps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
849 B
C#
20 lines
849 B
C#
using Schaad.OpenData.Watercraft.Models;
|
|
|
|
namespace Schaad.OpenData.Watercraft.Analysis;
|
|
|
|
public sealed record VesselDimension(string Key, string Label, Func<Vessel, string> Categorize)
|
|
{
|
|
public const string NoEngine = "Ohne Motor";
|
|
public const string Unknown = "Unbekannt";
|
|
public const string NotSpecified = "Keine Angabe";
|
|
public const string NoSpecialUse = "Ohne besondere Verwendung";
|
|
|
|
public static IReadOnlyList<VesselDimension> All { get; } =
|
|
[
|
|
new("type", "Schiffsart", v => v.Type ?? Unknown),
|
|
new("propulsion", "Antrieb", v => v.Propulsion ?? Unknown),
|
|
new("fuel", "Treibstoff", v => v.Fuel ?? NoEngine),
|
|
new("emission", "Abgasnorm", v => v.EmissionGroup ?? (v.Fuel is null ? NoEngine : NotSpecified)),
|
|
new("use", "Verwendung", v => v.SpecialUse ?? NoSpecialUse),
|
|
];
|
|
}
|