Crime & public safety mapping
Mapping recorded crime: city open data, hot spots and kernel density, rates per resident, time patterns, near repeats, street segments and what the records leave out.
A crime map is a map of recorded incidents: what was reported to or found by the police, classified by an officer, moved to the block, and published with a delay. The guides here treat each of those steps as part of the method, and use one of the largest open crime datasets, the City of Chicago’s, every incident since 2001, to show how hotspots, rates, time patterns and near repeats are built and tested.
Every number comes from a run on the published data. Hotspots drawn from 2023 robberies are tested against 2024’s; rates are computed with two denominators, because the Loop ranks third per resident and last per resident plus job; midnight and noon are checked as placeholder times; and a Knox test separates repeats at the same block from near repeats around it.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Download and Map City Crime Data in Python
- How to Map Crime Hotspots with Kernel Density in Python
- How to Calculate Crime Rates per Resident in Python
- How to Analyse Crime by Hour and Day of Week in Python
- How to Test for Near-Repeat Burglary in Python
- How to Find Statistically Significant Crime Hotspots on a Hex Grid in Python
Show every how-to guide in this topic
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
Related topics
Subjects that keep coming up alongside this one, most overlap first.