DBSCAN-based hotspot mapping and prioritization of railway accidents on Rumo Malha Sul (Brazil), 2021–2025

Published: 12 October 2026| Version 1 | DOI: 10.17632/t5mfnv9x6g.1
Contributors:
,
,
, Lucas Gabriel Souza da Silva

Description

This dataset contains the code and computational environment for an analysis that identifies and ranks spatial concentrations (hotspots) of railway accidents on the Rumo Malha Sul (RMS) network, in southern Brazil. The analysis uses public occurrence records from Brazil’s National Land Transport Agency (ANTT) for the complete years 2021–2025, which total 1,084 RMS occurrences. DBSCAN is applied separately for each railway line, using only the kilometer position as the spatial reference. The reference configuration is ε = 0.60 km and min_samples = 4, chosen with the support of a k-distance curve. The clusters found are ranked with a Severity Score (5 × fatalities + 2 × injuries + 1 × occurrences). The reference configuration yields 59 candidate hotspot clusters. The highest-ranked are Curitiba (KM 104.58), Paranaguá (KM 3.85) and Jandaia do Sul (KM 289.30). A sensitivity analysis covers nine DBSCAN parameter combinations (ε ∈ {0.55, 0.60, 0.65} km; min_samples ∈ {3, 4, 5}) and three score weighting schemes (5:2:1, 10:3:1, 5:1:1). Spearman rank correlations between 0.90 and 1.00 indicate a stable prioritization. The notebook also compares the RMS accident profile with the other federal railway concessions (share of third-party involvement, level crossings and urban areas).

Files

Steps to reproduce

1. Download all files in this dataset (notebook, requirements.txt, README.md) into the same folder. 2. Install Python 3.10 or later (the results were generated with Python 3.13). 3. (Optional) Create and activate a virtual environment. 4. Install the dependencies: pip install -r requirements.txt 5. Make sure the machine has internet access. The notebook downloads the data directly from the ANTT Open Data Portal (https://dados.antt.gov.br), CKAN resource b3851bf8-9c4c-4452-93f6-ddaba3992e60, via the datastore_search API. No data file needs to be provided. 6. Open the notebook hotspots_ferroviarios_dbscan_RMS_2021_2025.ipynb in Jupyter (Jupyter Notebook, JupyterLab or VS Code). 7. Run all cells in order (Run All). DBSCAN is deterministic and uses no random seeds. 8. The notebook retrieves the data, standardizes it, keeps 2021-2025, runs DBSCAN (eps = 0.60 km, min_samples = 4) on Rumo Malha Sul occurrences, computes the Severity Score (5 x fatalities + 2 x injuries + 1 x occurrences), runs the sensitivity analyses and generates the figures and tables. Note: the ANTT may update its database. The results in this dataset were obtained with data accessed in September 2026, so re-running later may produce slightly different values.

Institutions

Categories

Data Science, Transportation Engineering, Spatial Analysis

Licence