Initial commit: Laadpalenviewer

Static-generation EV charging map for the Netherlands with two layers
(passenger / logistics-freight), per-municipality crop-outs, and
gemeente + province boundaries from PDOK/CBS.

- data-pipeline/ (Node/TS): NDW OCPI download + classify (freight >=350kW /
  MCS / megawatt / Milence,WattHub) + external sources (curated, OCM, EAFO)
  + PDOK CBS boundaries -> static GeoJSON/JSON.
- webapp/ (Next.js 16 + React 19 + deck.gl + MapLibre): national view loads
  all points without details; selecting a gemeente eagerly loads its detail
  bundle (OCPI EVSE/connector/tariff + status) for instant marker clicks.
  Passenger colored by OCPI status (fleetsim-style), freight amber/megawatt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Robbert Janssen
2026-06-02 15:26:56 +02:00
co-authored by Claude Opus 4.8
commit ab9ed8abb8
733 changed files with 18413 additions and 0 deletions
+136
View File
@@ -0,0 +1,136 @@
// Types mirroring the static data files produced by data-pipeline.
export type ChargeLayer = "passenger" | "freight";
export type AggregateStatus = "AVAILABLE" | "CHARGING" | "UNAVAILABLE" | "UNKNOWN";
export interface Municipality {
name: string;
slug: string;
province: string;
population: number;
code: string | null;
passengerCount: number;
freightCount: number;
}
export interface ChargeProperties {
type: "charge";
layer: ChargeLayer;
locationId: string;
name: string;
address: string;
city: string;
operatorName: string;
maxPowerKw: number;
isMegawatt: boolean;
status: AggregateStatus;
source: string; // 'ndw' | 'curated' | 'eafo' | 'ocm'
}
export interface BoundaryProperties {
type: "boundary";
gemeente: string;
code: string;
}
export type FeatureProperties = ChargeProperties | BoundaryProperties;
export interface ChargeFeature {
type: "Feature";
geometry: { type: "Point"; coordinates: [number, number] };
properties: ChargeProperties;
}
export interface BoundaryFeature {
type: "Feature";
geometry: { type: "Polygon" | "MultiPolygon"; coordinates: unknown };
properties: BoundaryProperties;
}
export type AnyFeature = ChargeFeature | BoundaryFeature;
export interface CropoutData {
type: "FeatureCollection";
metadata: {
gemeente?: string;
slug?: string;
code?: string;
generated_at: string;
total_passenger?: number;
total_freight?: number;
layer?: ChargeLayer;
total?: number;
bounds?: [number, number, number, number];
operators?: string[];
};
features: AnyFeature[];
}
// "With details" payload (per-gemeente bundle: locationId -> EnrichedLocation).
export interface EnrichedConnector {
id: string;
standard: string;
format: string;
power_type: string;
max_voltage?: number;
max_amperage?: number;
max_electric_power?: number;
tariff_ids?: string[];
tariffs: EnrichedTariff[];
last_updated: string;
}
export interface EnrichedTariff {
id: string;
currency: string;
elements: Array<{
price_components?: Array<{ type: string; price: number; vat?: number; step_size?: number }>;
}>;
}
export interface EnrichedEVSE {
uid: string;
evse_id: string;
status: string;
capabilities?: string[];
physical_reference?: string;
connectors: EnrichedConnector[];
last_updated: string;
}
export interface EnrichedLocation {
locationId: string;
ocpiId: string;
name: string;
address: string;
city: string;
postalCode?: string;
country: string;
latitude: number;
longitude: number;
parkingType?: string;
operatorName: string;
operatorWebsite?: string;
ownerName?: string;
twentyFourSeven: boolean;
lastUpdated: string;
layer: ChargeLayer;
maxPowerKw: number;
evses: EnrichedEVSE[];
}
export type DetailBundle = Record<string, EnrichedLocation>;
export interface Filters {
showPassenger: boolean;
showFreight: boolean;
showBoundary: boolean;
minPowerKw: number;
}
export const DEFAULT_FILTERS: Filters = {
showPassenger: true,
showFreight: true,
showBoundary: true,
minPowerKw: 0,
};