Files
laadpalenviewer/analysis
robbertjanssen85andClaude Opus 4.8 22e54a57a5 Add current €/kWh prices per charger across the stack
NDW already publishes OCPI tariffs (embedded per connector); resolve the
cheapest currently-applicable ENERGY price and surface it everywhere:

- pipeline: tariff.ts resolveConnectorPrice() matches connector power +
  build-time (Europe/Amsterdam) against each element's restrictions, with
  a €0.05–5.0 sanity band. Baked onto EnrichedConnector.priceKwh and the
  location headline LightLocation.priceKwh (min across connectors) ->
  crop-out/national point properties. Preserved through freight merge.
- webapp: detail panel shows the resolved price (falls back to parsing the
  raw tariff); new "Kleur op prijs" filter colors points by €/kWh ramp with
  legend + hover price.
- analysis: chargers.py reads priceKwh from crop-outs -> price_kwh_median/
  _mean/_n + price_pct percentile -> "Prijs" choropleth metric + scorecard.
- regenerated data: ~40k locations priced (median ≈€0.39); all 342 gemeenten
  get a median price.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:24:18 +02:00
..

Laadpalenviewer — analysis (golden dataset)

Python layer that integrates open Dutch datasets into a "golden dataset" and exports derived map layers consumed by the webapp. Phase 1 works at gemeente grain; buurt/PC4 grain and more sources (BAG/BGT, NDW traffic, grid) follow.

Sources (open tier)

  • CBS Kerncijfers wijken en buurten 85984NED (CC-BY) — demographics, income, urbanisation, car ownership. Field keys live in src/ingest/cbs.py.
  • Charger supply/usage — our own webapp/public/data (municipalities.json, crop-out GeoJSONs, hourly snapshots).
  • PDOK CBS Gebiedsindelingen — gemeente polygons for the choropleth.

Run

cd analysis
python3 -m venv .venv && ./.venv/bin/pip install -r requirements.txt
./.venv/bin/python -m src.main            # uses caches in .cache/
./.venv/bin/python -m src.main --refresh  # re-fetch CBS/PDOK

Outputs:

  • data/gold_gemeente.{csv,parquet} — the golden dataset (gitignored).
  • webapp/public/data/derived/gemeente-metrics.geojson — choropleth layer (committed).
  • webapp/public/data/derived/metrics-meta.json — metric list for the viewer.

The viewer's Analyse (per gemeente) switcher (national view) renders any metric as a choropleth. Attribution: data © CBS (CC-BY), PDOK, NDW.