Skip to content

Data Source: Traffic Accidents

Slovenian traffic accident data is fetched from the AVP WFS API (nesrece.avp-rs.si). A historical importer for the policija.si annual ZIP files used to live alongside it but has been retired — AVP supplies the same fields plus drug-test data, unique participant IDs, hot-spot flags, and incremental fetching by date range.


Source: nesrece.avp-rs.si (AVP)

URL: http://nesrece.avp-rs.si/geo/wfsFormat: WFS (GeoServer) — supports GeoJSON, CSV, Excel, KML, Shapefile Access: Standard OGC WFS protocol with CQL filter support Layer: BSM:view_bpn_nTotal records: ~700k (704,781 as of April 2026) CRS: EPSG:3912 (Slovenian national grid)

How it works

  1. Query WFS endpoint with filters (date range, region, type, etc.)
  2. Paginate with startIndex + maxfeatures
  3. Response is GeoJSON with Point geometry per accident
  4. For each accident, call udel.php?key={key} to get the participant HTML table

The data-fetching worker (AvpAccidentsFetcher) fans out one job per day so a year-long backfill is bounded into ~365 short jobs instead of one giant one. See data-fetching/src/processors/sources/avp-accidents.fetcher.ts.

Request example

GET http://nesrece.avp-rs.si/geo/wfs?
  service=wfs&
  version=1.1.0&
  request=getfeature&
  typename=BSM:view_bpn_n&
  outputformat=application/json&
  maxfeatures=1000&
  startIndex=0&
  cql_filter=datum >= '2025-01-01' AND datum <= '2025-12-31'

Supported CQL filters

FilterExample
Date rangedatum >= '2025-01-01' AND datum <= '2025-12-31'
Regionregijao = 'OSREDNJESLOVENSKA'
Municipalityobcinao = 'LJUBLJANA'
Classificationklas = 'S' (S=death, H=serious, L=light, B=none)
Causevzrok = 'HI' (HI=speed, PD=priority, etc.)
Typetip = 'ČT' (ČT=head-on, BT=side, NT=rear-end, etc.)
Weathervreme = 'D' (D=rain, J=clear, M=fog, S=snow)
Road typelovc = '0' (0=motorway, 1=main I, H=expressway, etc.)
BboxBBOX(the_geom, 400000, 50000, 600000, 200000)
Participantsst_oseb > 2

Accident fields

FieldDescriptionExample
keyAccident ID001013229
datumDate (ISO)2022-12-29Z
mesecMonth12
danDay of week (0=Sun)5
dannocDay/nightdan
ura_int1Hour interval23-24
regijaoStatistical regionPODRAVSKA
obcinaoMunicipalityMARIBOR
klasClassification codeS / H / L / P / B / O
priorityPriority (severity rank)4
tipAccident type codeČT / BT / NT / TO / ...
vzrokCause codeHI / PD / SV / PR / ...
vremeWeather codeJ / D / M / S / ...
povrsjeRoad surface codeSU / MO / SN / ...
vozisceRoad pavement codeAH / AN / AZ / MA
prometTraffic codeN / G / R / Z
lovcRoad class code05, H, L, N, T, V
nasSettlement (D/N)D
krajLocation type codeC / R / Z / P / ...
cestaRoad number102
odsekSection number1006
stacChainage000005900
pcestaoRoad nameROBIČ-IDRIJA-LOGATEC
podsekoSection nameIDRSKO-PERŠETI
osebeParticipants (compressed){D;OA;[25-34];0;0;P;0,N;PT;...}
st_osebNumber of participants3
ishsIs "hot spot"true / false
the_geomPoint (EPSG:3912)[461234, 100567]

Participant detail endpoint

No WFS/API exists for participants. The GeoServer only exposes BSM:view_bpn_n (accidents). The REST API is locked (401). The only way to get detailed participant records is this PHP endpoint. No JSON variant — ?format=json still returns HTML.

URL: http://nesrece.avp-rs.si/udel.php?key={accident_id}Format: HTML table (one row per participant, needs parsing) Access: GET request with the accident key field

FieldDescriptionExample
idpnAccident ID001111922
ID osebeParticipant ID (unique)009265399
datumDate (DD.MM.YYYY)21.04.2025
udeleženecParticipant typevoznik osebnega avtomobila
poškodbaInjury typehuda telesna poškodba
povzročiteljCauser (da/ne)ne
spolSexženska / moški
starostExact age59
zaščitaSafety equipment (da/ne)da
stažDriving experience (YYL MMM)01L03M = 1 year 3 months
državljanstvoCitizenshipSLOVENIJA
alkotest odrejenBreathalyzer ordered (D/N)D
alkotestBreathalyzer resultNEGATIVEN / POZITIVEN
alkotest vrednostBreathalyzer value0.00
etilometer odrejenEthylometer ordered (D/N)N
etilometerEthylometer result(empty if not ordered)
etilometer vrednostEthylometer value0.00
str. pr. odrejenMedical exam ordered (D/N)D
str. pr.Medical exam resultPOZITIVEN
str. pr. vrednostMedical exam value01.76
str. pr. mamila odrejenDrug test ordered (D/N)D
str. pr. mamilaDrug test result(empty)
str. pr. mamila vrednostDrug test valueN
mamila hitri testRapid drug testN

Notes & caveats

  • HTTP only (no TLS listener on the host).
  • Participant detail requires one HTTP call per accident; the per-day fetch model keeps the working set bounded (~50–150 accidents/day → ~50–150 follow-up calls).
  • Coordinates are in EPSG:3912 — projected to WGS84 by data-processing/src/common/coordinate-projector.ts.
  • No documented rate limits — fetcher uses sequential per-day jobs to be polite.