Check the Setup
- Python 3.10 or newer
- An internet connection
- The requests Python package
Dutch compressed road-closure and safety-message records for building a dated traffic-disruption map.
Report a ProblemFrom Source to Product Signal
The official NDW index publishes separate closure and safety-message DATEX files. Start with two Dutch closure records; a listed restriction is not a complete route planner or safety instruction.
Install the packages, then run the notebook cell.
python -m pip install requests
import gzip
import io
import itertools
import requests
from xml.etree import ElementTree as ET
url = "https://opendata.ndw.nu/tijdelijke_verkeersmaatregelen_afsluitingen.xml.gz"
response = requests.get(url, timeout=20)
response.raise_for_status()
assert len(response.content) < 1_000_000
xml = gzip.decompress(response.content)
assert len(xml) < 5_000_000
records = (element for _, element in ET.iterparse(io.BytesIO(xml), events=("end",))
if element.tag.endswith("}situationRecord"))
for record in itertools.islice(records, 2):
print(record.get("id"), record.get("version"))Test a Useful Signal
Inspect two Dutch closure records with source timestamps.
Nationaal Dataportaal Wegverkeer is a government source. Last verified 2026-09-28. Temporal coverage: current observations or notices.