-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethodology.html
More file actions
463 lines (402 loc) · 17.8 KB
/
methodology.html
File metadata and controls
463 lines (402 loc) · 17.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Processing Methodology - SA Crash Data Map</title>
<style>
:root {
--bg-primary: #ffffff;
--bg-secondary: #f5f5f5;
--text-primary: #2a2a2a;
--text-secondary: #666666;
--accent: #4a90e2;
--accent-hover: #3a7bc8;
--border: rgba(0, 0, 0, 0.1);
--shadow: rgba(0, 0, 0, 0.1);
--code-bg: #2a2a2a;
--code-text: #e0e0e0;
}
[data-theme="dark"] {
--bg-primary: #1a1a1a;
--bg-secondary: #2a2a2a;
--text-primary: #e0e0e0;
--text-secondary: #a0a0a0;
--accent: #4a90e2;
--accent-hover: #5a9ff0;
--border: rgba(255, 255, 255, 0.1);
--shadow: rgba(0, 0, 0, 0.4);
--code-bg: #1a1a1a;
--code-text: #e0e0e0;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
transition: background 0.3s ease, color 0.3s ease;
}
.container {
max-width: 900px;
margin: 0 auto;
padding: 40px 20px;
}
header {
background: var(--bg-secondary);
border-bottom: 3px solid var(--accent);
padding: 30px 0;
margin-bottom: 40px;
}
header .container {
padding: 0 20px;
}
h1 {
color: var(--accent);
font-size: 32px;
margin-bottom: 10px;
}
.subtitle {
color: var(--text-secondary);
font-size: 16px;
}
.back-link {
display: inline-block;
color: var(--accent);
text-decoration: none;
margin-bottom: 30px;
font-weight: 600;
transition: all 0.3s;
}
.back-link:hover {
color: var(--accent-hover);
transform: translateX(-5px);
}
.methodology-section {
background: var(--bg-secondary);
border-left: 4px solid var(--accent);
padding: 25px;
margin-bottom: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px var(--shadow);
}
h2 {
color: var(--accent);
font-size: 22px;
margin-bottom: 15px;
}
h3 {
color: var(--accent);
font-size: 18px;
margin: 20px 0 10px 0;
}
p {
margin-bottom: 15px;
color: var(--text-primary);
}
ul, ol {
margin-left: 30px;
margin-bottom: 15px;
}
li {
margin-bottom: 8px;
}
code {
background: var(--code-bg);
color: var(--code-text);
padding: 2px 6px;
border-radius: 4px;
font-family: 'Courier New', monospace;
font-size: 14px;
}
.info-box {
background: rgba(74, 144, 226, 0.1);
border-left: 4px solid var(--accent);
padding: 15px;
margin: 20px 0;
border-radius: 8px;
}
.info-box strong {
color: var(--accent);
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
background: var(--bg-primary);
box-shadow: 0 2px 8px var(--shadow);
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid var(--border);
}
th {
background: var(--accent);
color: white;
font-weight: 600;
}
tr:hover {
background: var(--bg-secondary);
}
footer {
margin-top: 60px;
padding-top: 30px;
border-top: 2px solid var(--border);
text-align: center;
color: var(--text-secondary);
font-size: 14px;
}
footer a {
color: var(--accent);
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
@media (max-width: 768px) {
h1 {
font-size: 26px;
}
h2 {
font-size: 20px;
}
.container {
padding: 20px 15px;
}
.methodology-section {
padding: 20px;
}
table {
font-size: 14px;
}
th, td {
padding: 8px;
}
}
</style>
</head>
<body>
<header>
<div class="container">
<h1>Data Processing Methodology</h1>
<p class="subtitle">SA Crash Data Map 2012-2024</p>
</div>
</header>
<div class="container">
<a href="index.html" class="back-link">← Back to Map</a>
<div class="methodology-section">
<h2>Overview</h2>
<p>This page documents the data processing methodology used to prepare the South Australian crash data for visualization on this website. The goal is to provide transparency about how the raw data has been transformed and to help users understand any limitations or considerations when interpreting the visualizations.</p>
</div>
<div class="methodology-section">
<h2>Data Sources</h2>
<p>All data is sourced from publicly available datasets published by <strong>Data SA</strong> (Government of South Australia):</p>
<ul>
<li><strong>Primary Dataset:</strong> Road Crash Data (2012-2024)</li>
<li><strong>Source URL:</strong> <a href="https://data.sa.gov.au" target="_blank" rel="noopener noreferrer" style="color: var(--accent);">data.sa.gov.au</a></li>
<li><strong>Data Format:</strong> CSV (Comma-Separated Values)</li>
<li><strong>Update Frequency:</strong> Periodically updated by Data SA</li>
<li><strong>Coverage Period:</strong> January 1, 2012 to December 31, 2024</li>
</ul>
<div class="info-box">
<strong>Note:</strong> The datasets are published by the South Australian Government under open data licensing terms. Please refer to Data SA for the most current and official data.
</div>
</div>
<div class="methodology-section">
<h2>Data Processing Steps</h2>
<h3>1. Data Collection & Consolidation</h3>
<p>Yearly crash data files (2012-2024) were collected from Data SA and consolidated into a single unified dataset. This process involved:</p>
<ul>
<li>Downloading individual yearly CSV files from Data SA</li>
<li>Merging multiple datasets while preserving all original records</li>
<li>Creating a combined dataset for efficient querying and visualization</li>
</ul>
<h3>2. Data Cleaning & Standardization</h3>
<p>To ensure consistency across different yearly releases, the following standardization procedures were applied:</p>
<h4>Column Name Standardization</h4>
<ul>
<li>Inconsistent column names across years were normalized to a common schema</li>
<li>Whitespace and special characters in column headers were standardized</li>
<li>Column names were made case-consistent for reliable programmatic access</li>
</ul>
<h4>Data Type Validation</h4>
<ul>
<li>Numeric fields (e.g., year, casualty counts) validated and converted to appropriate types</li>
<li>Date and time fields parsed and standardized to ISO 8601 format where applicable</li>
<li>Text fields trimmed of leading/trailing whitespace</li>
</ul>
<h4>Missing Data Handling</h4>
<ul>
<li>Empty fields preserved as empty strings (not converted to null/undefined arbitrarily)</li>
<li>No imputation or artificial data generation performed</li>
<li>Missing geographic coordinates excluded from mapping visualizations</li>
</ul>
<h3>3. Geographic Coordinate Processing</h3>
<p>The crash data includes geographic coordinates that enable map-based visualization:</p>
<ul>
<li><strong>Coordinate System:</strong> Original data uses GDA2020 / MGA Zone 54 (EPSG:7854)</li>
<li><strong>Conversion:</strong> Coordinates converted to WGS84 (latitude/longitude) using Proj4js library for web mapping compatibility</li>
<li><strong>Validation:</strong> Records with missing or invalid coordinates excluded from map layers</li>
<li><strong>Precision:</strong> Coordinates displayed with standard precision; exact crash locations may be approximate</li>
</ul>
<div class="info-box">
<strong>Important:</strong> Geographic coordinates should be considered approximate. They are suitable for visualization and general analysis but not for precise location-based decisions.
</div>
<h3>4. Categorical Data Harmonization</h3>
<p>Categorical fields (e.g., crash severity, weather conditions, crash type) were standardized:</p>
<ul>
<li>Consistent encoding of categories across years</li>
<li>Removal of redundant or duplicate category labels</li>
<li>Preservation of original category meanings without reclassification</li>
</ul>
<h3>5. Temporal Data Processing</h3>
<ul>
<li>Crash dates and times preserved in original form where available</li>
<li>Year extracted and validated for filtering purposes</li>
<li>Time-of-day filters support 24-hour format</li>
</ul>
</div>
<div class="methodology-section">
<h2>Data Schema</h2>
<p>The consolidated dataset includes the following key fields:</p>
<table>
<thead>
<tr>
<th>Field Category</th>
<th>Example Fields</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Temporal</strong></td>
<td>Year, Date, Time, Day/Night</td>
<td>When the crash occurred</td>
</tr>
<tr>
<td><strong>Geographic</strong></td>
<td>Latitude, Longitude, Area/LGA, Suburb</td>
<td>Where the crash occurred</td>
</tr>
<tr>
<td><strong>Severity</strong></td>
<td>Crash Severity, Casualties, Fatalities</td>
<td>Impact and outcomes</td>
</tr>
<tr>
<td><strong>Crash Characteristics</strong></td>
<td>Crash Type, Weather, Road Surface</td>
<td>Conditions and type of crash</td>
</tr>
<tr>
<td><strong>Vehicles & Units</strong></td>
<td>Vehicle Type, Heavy Vehicle, Unit Count</td>
<td>Vehicles involved in crash</td>
</tr>
<tr>
<td><strong>Casualties</strong></td>
<td>Road User Type, Age, Sex, Injury Extent</td>
<td>People affected by crash</td>
</tr>
<tr>
<td><strong>Contributing Factors</strong></td>
<td>DUI, Drugs, Speed, Seat Belt</td>
<td>Factors related to crash occurrence</td>
</tr>
</tbody>
</table>
</div>
<div class="methodology-section">
<h2>Visualization Processing</h2>
<h3>Marker Clustering</h3>
<ul>
<li>Individual crash points clustered using Leaflet MarkerCluster library</li>
<li>Clustering performed client-side for responsive interaction</li>
<li>Cluster size indicates number of crashes in geographic proximity</li>
</ul>
<h3>Density Map Visualization</h3>
<ul>
<li>Point density layer generated using Leaflet.heat library with tight radius settings</li>
<li>Individual crashes rendered with minimal blur for precise location visualization</li>
<li>Color intensity represents both crash density and severity weighting</li>
<li>Severity-weighted: Fatal (4x), Serious Injury (3x), Minor Injury (2x), PDO (1x)</li>
<li>Radius and blur scale with zoom level for optimal viewing at all scales</li>
<li>Follows road patterns naturally, creating linear density corridors</li>
</ul>
<h3>Choropleth Mapping</h3>
<ul>
<li>LGA (Local Government Area) boundaries used for choropleth visualization</li>
<li>Crash counts aggregated by geographic region</li>
<li>Color intensity proportional to crash frequency</li>
</ul>
</div>
<div class="methodology-section">
<h2>Filtering & Aggregation</h2>
<p>The website provides extensive filtering capabilities. All filters are applied client-side:</p>
<ul>
<li><strong>Temporal Filters:</strong> Year range, date range, time of day</li>
<li><strong>Severity Filters:</strong> Crash severity levels, injury extent</li>
<li><strong>Geographic Filters:</strong> LGA/area, location search with radius</li>
<li><strong>Condition Filters:</strong> Weather, road surface, day/night</li>
<li><strong>Vehicle Filters:</strong> Vehicle type, heavy vehicle involvement</li>
<li><strong>Casualty Filters:</strong> Age group, road user type, safety equipment usage</li>
</ul>
<p>Statistics are recalculated dynamically based on active filters to show relevant totals and counts.</p>
</div>
<div class="methodology-section">
<h2>Data Integrity & Quality Assurance</h2>
<h3>Validation Checks</h3>
<ul>
<li>Record count verification against source datasets</li>
<li>Coordinate validity checks (within South Australia bounds)</li>
<li>Date and time range validation</li>
<li>Categorical value consistency checks</li>
</ul>
<h3>Known Limitations</h3>
<ul>
<li>Some records may have incomplete data fields</li>
<li>Geographic coordinates are approximate and may not reflect exact crash locations</li>
<li>Data is dependent on reporting accuracy and completeness in source datasets</li>
<li>Historical data may have different collection or reporting standards than recent data</li>
<li>Not all crashes may be represented in the dataset</li>
</ul>
</div>
<div class="methodology-section">
<h2>Tools & Technologies</h2>
<p>The following tools and libraries were used in data processing and visualization:</p>
<ul>
<li><strong>Python:</strong> Data cleaning and consolidation (pandas, csv libraries)</li>
<li><strong>Leaflet.js:</strong> Interactive mapping library</li>
<li><strong>Proj4js:</strong> Coordinate system transformation</li>
<li><strong>PapaParse:</strong> CSV parsing in browser</li>
<li><strong>Turf.js:</strong> Geospatial analysis and calculations</li>
<li><strong>noUiSlider:</strong> Range filter controls</li>
</ul>
</div>
<div class="methodology-section">
<h2>Updates & Versioning</h2>
<p>As new data becomes available from Data SA, the dataset may be updated. Major updates will be documented here with version information and change notes.</p>
<p><strong>Current Version:</strong> 2012-2024 Dataset (February 2026)</p>
</div>
<div class="methodology-section">
<h2>Reproducibility & Transparency</h2>
<p>This project aims to maintain transparency in data processing. Users who wish to verify the processing methodology or reproduce the dataset can:</p>
<ul>
<li>Access the original source data from Data SA</li>
<li>Review the processing scripts (available in project repository if open-sourced)</li>
<li>Contact the project maintainer with questions or concerns</li>
</ul>
</div>
<footer>
<p><a href="index.html">Back to Map</a> | <a href="disclaimer.html">Disclaimer</a></p>
<p style="margin-top: 15px;">SA Crash Data Map © 2026 | <a href="LICENSE">MIT License</a></p>
<p style="margin-top: 10px; font-size: 12px;">Last Updated: February 2026</p>
</footer>
</div>
</body>
</html>