Skip to content

hudcostreets/nj-crashes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,654 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NJ Car Crash Data

Analysis of NJ State Police fatal crash data (2008-present) and NJDOT crash data (2001-2023)

Fatal crash data updates daily (via GitHub Action), plots below are current through either the most recent month or year.

NJ traffic deaths w/ 12mo rolling avg

2021 and 2022 set 17-year highs for traffic deaths in NJ

(NJSP only includes victim-type data since 2020)

In NJ, traffic deaths are 1.5x-2x homicides

(Uniform Crime Reports 1990-2020, Disaster Center 1960-2019)

Traffic deaths, by month


Setup

This project uses uv for Python dependency management:

# Install dependencies
uv sync

# Run scripts
uv run njsp refresh_data
uv run njdot compute db

# Or activate the virtual environment
source .venv/bin/activate
njsp refresh_data

Data Management

This repository tracks two distinct crash datasets with different update patterns:

NJSP (Daily Updates, Git-tracked)

  • Source: NJ State Police fatal crash XMLs
  • Coverage: Fatal crashes only, 2008-present
  • Update Frequency: Daily (via GitHub Action)
  • Size: Small (~1-2MB databases)
  • Storage: XMLs committed to git, databases regenerated locally
  • Regenerate:
    njsp refresh_data  # By default, current year and 2 preceding
    njsp update_data   # Generate parquets from XMLs
    njsp update_pqts   # Update SQLite databases

NJDOT (Annual Updates, DVC-tracked)

  • Source: NJDOT crash data (zip files)
  • Coverage: All crashes (fatal, injury, property damage), 2001-present
  • Update Frequency: Annual
  • Size: Large (2.4GB crashes.db, ~280MB parquets)
  • Storage: DVC-tracked, stored in S3
  • Pipeline: See njdot/README.md
  • Pull databases:
    dvc pull www/public/njdot/crashes.db.dvc
    # Or regenerate (slow, requires geo-processing):
    env -u PYTHONPATH njdot compute pqt -f
    env -u PYTHONPATH njdot compute db -f

Analysis

NJDOT crash data parsing / analysis in njdot/.

About

Analysis and visualization of traffic crash data published by NJ DOT and NJ State Police

Topics

Resources

Stars

Watchers

Forks

Contributors