# priecestia: railway level crossings on the roads of okres Senec

One record per level crossing of a railway with a road that SSC's road databank (Cestná databanka) keeps, in okres
Senec: 7 crossings in the snapshot of 1 Jan 2026, all on class III roads, 1 of them in the town (SP1993 on III/1049).
Built by `scripts/fetch_priecestia.py`. Placed with OpenStreetMap, which carries each crossing's ŽSR number.

## Rebuild

```bash
python scripts/fetch_priecestia.py              # the newest yearly CSV and one Overpass request
python scripts/fetch_priecestia.py --offline    # from the cached downloads in data/atlas/raw/priecestia/ (not committed)
```

## Files

| File | Content |
|---|---|
| `priecestia.json` | a list of records, the town's first, then by road |
| `priecestia.csv` | the same records, one row each, same columns (a list is joined with spaces). UTF-8, CRLF, empty = null |

## Sources

| What | Where |
|---|---|
| Crossings, their road, tracks, protection, year built, size | SSC, Cestná databanka, „Železničné priecestia k 1.1.2026“, `https://www.cdb.sk/files/documents/cestna-databanka/vystupy-cdb/2026/csv/sr_co_zeleznicnepriecestie_2026-01-01.csv` (cp1250, `;`; CC BY 4.0, listed in the national open data catalogue). One file a year since 2022; the script takes this year's, or last year's until this year's is out. |
| Position | OpenStreetMap, `railway=level_crossing` nodes whose `ref` is the crossing's ŽSR number, read through Overpass. © OpenStreetMap contributors, ODbL. |

## Fields

- `record_id`: the ŽSR number in lower case (`sp1993`). Stable.
- `zsr_number`: the ŽSR crossing number as the CDB prints it („JIČ ŽSR“), e.g. `SP1993`.
- `road` (`III/1049`), `road_class` (`I`, `II`, `III`).
- `chainage_km`: the crossing's start on the road's kilometre posts („kilometrovníkové staničenie“); null where the
  CDB leaves it empty (2 of 7). `cumulative_km`: the same on the road's cumulative chainage („kumulatívne
  staničenie“). The two systems differ; they are not interchangeable.
- `tracks`, `protection` (as printed: „signalizácia“ = lights, „signalizácia + závory“ = lights and barriers),
  `built` (year), `length_m` and `area_m2` of the crossing's surface.
- `okres`; `in_town`: true when the position lies inside Senec's municipal boundary
  (`sources/osm/senec_boundary.json`), null without a position.
- `lat`, `lon`: the centre of the OSM nodes with the crossing's number (a crossing is often drawn as one node per
  track or carriageway); `osm_nodes`: their ids; `position_source`: the first node's page.
- `road_owner`, `road_manager`: as the CDB prints them (`BA SK` is Bratislavský samosprávny kraj; `SC BSK` its road
  administration).
- `snapshot`: the CDB file's reference date. `source_url`: that file. `licence`. `last_update`: the day the record
  last changed.

## Caveats

- **Roads SSC keeps only.** A crossing on a local street or a field road is not in the CDB file. Accidents at level
  crossings in the okres are counted in `atlas/bezpecnost` (`at_level_crossing`, from the police overview).
- The position comes from OpenStreetMap volunteers, matched by the ŽSR number only; a crossing OSM does not number
  would have no position (none on 26 Oct 2026).

## License

Published by Som Senec under the Open Database License 1.0 (ODbL 1.0): https://opendatacommons.org/licenses/odbl/1-0/. It contains data from OpenStreetMap, © OpenStreetMap contributors, which the ODbL requires to stay under the ODbL. Credit "© OpenStreetMap contributors" and "Som Senec, somsenec.sk", and publish an adapted version under the ODbL. The source documents that each record links to keep their own terms.
