# nehody-cesty: each accident on motorways and class I and II roads (okres Senec)

One record per road accident that the police list in the ISDN "Topografická zostava" for územný okres Senec
(`5108`): accidents on motorways (D), expressways (R) and class I and II roads, with the road, the kilometre and
the time. Built on 25 Oct 2026 by `scripts/fetch_bezpecnost.py`, which also writes `bezpecnost` (okres totals).

## Rebuild

```bash
python scripts/fetch_bezpecnost.py            # writes bezpecnost.*, nehody-cesty.json + .csv and nehodove-useky.json + .csv
python scripts/fetch_bezpecnost.py --isdn-month 2026-09 --nehody-json /tmp/n.json --nehody-csv /tmp/n.csv   # pin the partial year
```

Raw pages are cached in `raw/bezpecnost/isdn/` (not committed) and re-used unless `--refresh` is given.

## Files

| File | Content |
|---|---|
| `nehody-cesty.json` | a list of records, one per accident, sorted by `occurred_at` |
| `nehody-cesty.csv` | the same records, one row each, same columns. UTF-8, CRLF, empty = null |

## Source

| What | URL |
|---|---|
| Topografická zostava, okres Senec, from 1 January | `https://www.minv.sk/lnisdn/statistika/<folder>/statistika/stvrtrocna/topor/topor-5108.html` |
| Code lists of the same folder | `https://www.minv.sk/lnisdn/statistika/<folder>/statistika/vysvetlivky-ciselniky.html` |
| Item codes (section 1.3) | `https://www.minv.sk/lnisdn/statistika/<folder>/statistika/vysvetlivky.html` |
| Vehicle categories before 2019 | `vysvetlivky.html` of the December 2018 folder (`20190219_193757.394_2018-12-MS`) |
| Folders by month | `https://www.minv.sk/?statistika-1&rok=<Y>&mesiac=<M>`; index: https://www.minv.sk/?kompletna-statistika |

Each full year comes from its December folder. The current year comes from the latest quarter-end folder
(the report is quarterly), now 1.1.–30.9.2026.

## Records

| Year | Records | Okres total (`bezpecnost`) |
|---|---|---|
| 2019 | 68 | 196 |
| 2020 | 50 | 170 |
| 2021 | 36 | 171 |
| 2022 | 36 | 169 |
| 2023 | 41 | 154 |
| 2024 | 41 | 183 |
| 2025 | 45 | 187 |
| 2026 (to 30.9.) | 26 | 169 |

By road, 2019 to 30.9.2026: D1 189, I/61 63, II/503 27, I/63 24, I/62 13, R7 13, II/572 8, II/510 5, D4 1.

## Fields

Item codes in brackets are the report's own (`vysvetlivky.html`, section 1.3). Coded items carry the label of the
code list in the same folder, as printed, with runs of spaces collapsed to one. A code the list marks "nezadané"
(`-1`) and an empty cell are null.

- `record_id`: the police's number in the electronic accident book (eKDN), e.g. `510040-25-00029`. Stable.
- `year`, `report_period` (the report's "Za obdobie"), `partial_year` (true until the year's December report).
- `road` as the report prints it (`D1`, `R7`, `61`, `503`); `road_class` `D`, `R`, `I` (one or two digits) or
  `II` (three digits).
- `road_km` (38): the kilometre of the road's own chainage, from the metres printed (`15500` = 15.5).
- `occurred_at` (02): the latest possible time of the accident, local time, `YYYY-MM-DDTHH:MM`.
- `reporting_delay` (03), `locality` (05, in or outside a built-up area), `accident_type` (06), `collision_type` (07),
  `fixed_obstacle` (08), `fault` (10, who or what caused it), `main_cause` (12, first level of NdnPriciny).
- `killed` (13A), `seriously_injured` (13B), `lightly_injured` (13C): people. `material_damage_eur` (14): €.
- Road and conditions: `surface_type` (16), `surface_quality` (17), `surface_condition` (18), `shoulder_condition`
  (19), `road_defect` (20), `weather` (21), `visibility` (22), `sight_lines` (23), `traffic_control` (24),
  `road_layout` (25), `position_on_road` (26), `specific_place` (27), `alignment` (28), `junction` (35),
  `crossing_road_type` (39).
- Pedestrians: `pedestrian_behaviour` (31), `pedestrian_situation` (32).
- Vehicles: `vehicles_involved` (34); the first at-fault vehicle's `at_fault_vehicle_category` (44aA) and
  `at_fault_vehicle_type` (44bA), operator (48, `at_fault_vehicle_operator`), transport (49, `at_fault_transport`),
  direction (52A, `at_fault_direction`); the first other vehicle's `other_vehicle_category` (44aB),
  `other_vehicle_type` (44bB) and `other_direction` (52B); `vehicle_after_accident` (50);
  `driver_external_influence` (58).
- `blackspot_id` (26 Oct 2026): the `record_id` of the police's blackspot stretch the accident is listed in
  (`nehodove-useky`, e.g. `2025-D1-15000-16000`), null for the others; 25 of 343.
- `source_url`: the report the record was read from. `last_update`: the day the record last changed.

**Left out:** alcohol found (11), the pedestrian's state (30), the pedestrian's year of birth (33D) and the
at-fault driver's state (57). They describe a person rather than the accident, and their code lists include
illness, invalidity and suicide. The okres totals of accidents under alcohol are in `bezpecnost`.

## Caveats

- **Not every accident.** The report lists the accidents on D, R, I and II roads: about a quarter of the okres
  total (343 of 1 399 since 2019). Class III roads, car parks and the roads the police do not keep in the
  kilometre system (most of the town's streets; 135 of 187 accidents in 2025) are not in it.
- **Checked against the police's own totals.** For every year, the records of each road class add up to the
  accidents, deaths, serious and light injuries and damage that the okres overview (`dnvr-5108`) of the same
  folder gives for that class. One exception, in the source: for 2022 the overview counts 2 accidents on R roads
  (€4 700 damage), and that year's Topografická zostava has no R7 section.
- **No coordinates and no town.** A place is a road and a kilometre of that road's chainage. Which kilometres lie
  inside Senec needs SSC's road chainage (Cestná databanka); this dataset does not place them. `locality` is
  empty on 280 of 343 records and otherwise "v obci", without naming the municipality.
- The report covers the whole územný okres Senec, so D1 and R7 records lie partly outside the town.
- Vehicle categories changed in 2019 (law 106/2018). The 2019 report still uses the older first-level codes
  18–28, which its own code list no longer has; those are decoded with the December 2018 list. The same
  vehicle class therefore reads "motorové vozidlá … - M" in some 2019 records and "M - motorové vozidlá …" later.
- A partial year is replaced as a whole on every run: the police may still correct a record (a death within 30
  days counts as killed), so `last_update` moves when a record's content changes.

## License

Published by Som Senec without a licence of its own (Podmienky zdroja): https://somsenec.sk/data#podmienky-zdroja. The records are an extract from a source that states no licence; the README above names it and each record links to it. Credit that source and "Som Senec, somsenec.sk", and keep to the source's terms.
