# Script 23 - SCATS Exposure-Adjusted Intersection League Table v0.1

This implements the fifth high-impact next analysis:

```text
Which signalised intersections have the highest road harm after adjusting for traffic exposure?
```

## Why this matters

Raw crash rankings can be dismissed with:

```text
busy places have more crashes
```

This script adds exposure-adjusted rankings using observed SCATS movements.

## Inputs used

```text
A:\TrafficAnalytics\ROADCRASHDATA\outputs\08b_all_council_summary_cleaned_v0_2\all_councils_scats_site_summary.csv
A:\TrafficAnalytics\ROADCRASHDATA\outputs\08b_all_council_summary_cleaned_v0_2\all_councils_scats_matched_summary.csv
```

## Default rate filter

```text
minimum movements: 1,000,000
minimum matched crashes: 3
```

This prevents very low-volume artefacts from dominating the rate table.

## Main output folder

```text
A:\TrafficAnalytics\ROADCRASHDATA\outputs\23_scats_intersection_league_table
```

Important CSVs:

```text
scats_intersection_priority_all_sites_v0_1.csv
scats_intersection_council_summary_v0_1.csv
top_250_scats_priority_sites_v0_1.csv
top_250_scats_total_harm_sites_v0_1.csv
top_250_scats_harm_rate_sites_v0_1.csv
top_250_scats_fsi_rate_sites_v0_1.csv
top_250_scats_vru_sites_v0_1.csv
top_250_scats_heavy_vehicle_sites_v0_1.csv
scats_intersection_league_build_report_v0_1.txt
```

## Public pages

Statewide index:

```text
A:\TrafficAnalytics\ROADCRASHDATA\outputs\11_public_site\road_harm_intelligence\scats-intersections\index.html
```

Per-council pages:

```text
A:\TrafficAnalytics\ROADCRASHDATA\outputs\11_public_site\road_harm_intelligence\scats-intersections\councils\<slug>.html
```

## Council report patches

Each council report gets a new section:

```text
SCATS exposure-adjusted intersection league table
```

It is inserted after the Freight Conflict Index section where available.

## Run

From:

```powershell
A:\TrafficAnalytics\PROJECTS\road_harm_intelligence_build_pack_v0_1
```

run:

```powershell
powershell -ExecutionPolicy Bypass -File .\run_23_build_scats_intersection_league_table_v0_1.ps1
```

## Check

Open:

```text
A:\TrafficAnalytics\ROADCRASHDATA\outputs\11_public_site\road_harm_intelligence\scats-intersections\index.html
```

and:

```text
A:\TrafficAnalytics\ROADCRASHDATA\outputs\11_public_site\road_harm_intelligence\councils\council_reports\melbourne.html
```

## Deploy

After checking:

```powershell
powershell -ExecutionPolicy Bypass -File .\13_deploy_road_harm_site_to_webserver_v0_1.ps1
```

## Caveat

SCATS movements are an exposure proxy and crash-to-SCATS matching is proximity-based. This is a screening and prioritisation layer, not an engineering safety audit.
