Umferð (Traffic) — Vegagerðin

SkillDev tools

Icelandic traffic counters (Vegagerðin) — real-time 15-min counts, 7-day rolling daily totals, 168+ stations via WFS.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Umferð (Traffic) — Vegagerðin skill

What this skill tells your AI

The instructions your AI receives, as published by jokull/icelandic-data in .agents/skills/umferd/SKILL.md and read by ahel’s review.

Real-time traffic counter data from the Icelandic Road Administration via GeoServer WFS.

API

Base URL: https://gagnaveita.vegagerdin.is/geoserver/gis/ows?

No authentication required. WFS 1.0.0 protocol. Returns GeoJSON, CSV, GML, or Shapefile.

Layers

LayerFeaturesDescription
gis:umferdvika_2021_1~254Real-time counters: 15-min count, today's count, rolling 7-day daily totals
gis:umf_talningar_stefnugreint_stadir~248Station metadata with direction, elevation, compass heading

WFS Request Pattern

{base}?service=WFS&version=1.0.0&request=GetFeature&typeName={layer}&outputFormat=application/json&srsName=EPSG:4326

Parameters

ParameterValues
srsNameEPSG:4326 (WGS84) or EPSG:3057 (ISN93)
outputFormatapplication/json, csv, GML2, GML3, shape-zip
cql_filtere.g. IDSTOD=912 to filter by station
maxFeaturesLimit number of features returned

Example Requests

# All stations as GeoJSON (WGS84)
curl "https://gagnaveita.vegagerdin.is/geoserver/gis/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=gis:umferdvika_2021_1&outputFormat=application/json&srsName=EPSG:4326"

# Single station
curl "https://gagnaveita.vegagerdin.is/geoserver/gis/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=gis:umferdvika_2021_1&cql_filter=IDSTOD=912&outputFormat=application/json&srsName=EPSG:4326"

Real-Time Layer Schema (gis:umferdvika_2021_1)

FieldTypeDescription
OBJECTIDINTUnique per measurement point (direction-specific)
IDSTODINTStation ID (may appear twice for directional stations)
NAFNSTRINGStation name (e.g., "Gufuá", "Dettifoss")
STEFNASTRINGDirection — see below
UMF_15MININTVehicles in last 15 minutes
MEDALHRADI_15MININTAvg speed km/h last 15 min (only for type 4 classifiers)
UMF_I_DAGINTVehicles since midnight
DAGS_SIDUSTUGAGNADATETimestamp of latest data received
UMF_DAGUR1..7INTDaily vehicle count for last 1..7 days
DAGS_DAGUR1..7DATEDate for each of the 7 daily counts
MAELISTOD_TEGUNDINTStation type (see below)
SHAPEPOINTCoordinates [lon, lat] in requested SRS

Station Metadata Layer (gis:umf_talningar_stefnugreint_stadir)

FieldTypeDescription
IDSTADURSTRINGLocation ID
IDSTODINTStation ID
IDSTEFNAINTDirection code
NAFNSTRINGStation name
STEFNA_TXTSTRINGDirection text
NSAV_STEFNASTRINGCompass code
HAEDINTElevation (m)
UMFERDINTLatest traffic count
DAGS_UMFERDDATETimestamp of latest count
MEDALHRADIINTAverage speed (if available)
STAERDARFLOKKURSTRINGSize class ("all")
MAELISTOD_TEGUNDINTStation type

Station Types (MAELISTOD_TEGUND)

CodeTypeDescription
1VeðurstöðCounter co-located with weather station
2UmferðarteljariDedicated traffic counter
4UmferðargreinirTraffic classifier (provides speed data)

Direction Field (STEFNA)

  • Directional: "Til norðurs", "Frá Þingvöllum", etc.
  • Combined: "Samanlögð umferð óháð stefnu" (both directions summed)
  • Directional stations have two OBJECTIDs sharing the same IDSTOD

Double-count warning: When aggregating, use either combined records OR directional records, never both.

Key Caveat: No Historical API

The API only provides a rolling 7-day window. There is no endpoint for historical data. To build a time series, you must poll regularly (daily) and accumulate into a local store. The collect subcommand handles this.

Script Usage

# List all counting stations
uv run python scripts/umferd.py stations

# Fetch current real-time snapshot
uv run python scripts/umferd.py snapshot

# Collect rolling 7-day data into history (run daily via cron)
uv run python scripts/umferd.py collect

# Generate HTML traffic report
uv run python scripts/umferd.py report

Data Files

FileFormatDescription
data/raw/umferd/stations.csvCSVStation metadata with coordinates
data/raw/umferd/snapshot_*.jsonGeoJSONRaw API snapshots
data/processed/umferd_snapshot.csvCSVLatest real-time flat data
data/processed/umferd_daily.parquetParquetAccumulated daily history (append + dedup)
reports/umferd-traffic.htmlHTMLSelf-contained traffic report

Other Caveats

  • Encoding. GeoServer WFS returns UTF-8 GeoJSON. Station names contain Icelandic chars (Þingvellir, Hvalfjörður, Mývatn, Sólheimasandur); direction labels combine spatial Icelandic (Til norðurs, Frá Reykjavík). Read with httpx.json() defaults; write CSV with encoding="utf-8".
  • Rate-limiting. No declared rate limit on gagnaveita.vegagerdin.is. Intended cadence is one snapshot per quarter-hour (matches the source update interval). A daily collect cron is well within budget.
  • Double-counting directional data. A single physical site often emits two rows — one per direction. When summing flows for a region, group by station-id-without-direction or filter on a single STEFNA value.

Signals

GitHub stars
53
Forks
4
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
umferd
Source
github.com/jokull/icelandic-data