Engineering, 2026
Map apps find the shortest walk. SafePath also finds the safest one. Then it shows you what the safer route costs.
Finished and live: anyone can open the demo and plan a walk. It earned me college credit and a certificate in Penn's ESAP course.
A walking-route planner for the area around Penn. It draws the shortest and the safest route on one map, so you can see for yourself what the safer one costs.
- 10 high-risk blocks on the shortest walk from Penn Park to Mill Creek; the safe route has none
- 107 m extra walking that costs
- 106,881 recorded incidents behind the risk score

Why this project
The first time I was in a foreign city on my own, I picked my walking routes by instinct, and I had no way to tell whether the instinct was any good. Routing apps answer “shortest”. This one also answers “safest”, from the city’s own record of where crime has been reported, and draws both routes on the same map so you can see what the safer one costs.
The routing was the easy part. My first two ways of checking whether it worked were both wrong.
From a spreadsheet to a score on every street
I took the city’s 2024 to 2026 incident files, dropped duplicates and rows with no location, and kept the 3.5 km box around Penn: 397,464 rows became 106,881 incidents. OSMnx gave me the walkable street network for the same box. I attached each incident to the streets near it, scored every street, and routed on the result with NetworkX.
The risk score had been measuring street length
My first score divided each street’s crime weight by its length, which made the most dangerous places in the city three-meter crosswalk stubs. Ranking streets against one another instead fixed it, on the same data.
Two checks that failed in opposite directions
The first check added up the risk along each route and compared the totals. They differed by 1 to 2%, because the risk field is smooth and summing over a whole route washes the difference out.
The second check measured how much longer the safe route is, and it failed the other way. On a grid, moving one street over changes almost every block and barely changes the distance. A route whose blocks were 92% different read as “the same route” because it was only 3.4% longer.
I replaced both with things a person can picture: the number of high-risk blocks on each route, the meters of high-risk street, and how much of the two routes is different. Fig 3 shows three routes under those measures.
Saying when it cannot help
The list of high-risk blocks a route avoids depends on which way you ask: ask the other way and you get the ones the safe route walks into. The demo reports both. When you start inside a hotspot, the safe route can leave five high-risk blocks and enter five others. Then the number that still means something is the meters of high-risk street, 115 down to 56, and the demo says so instead of claiming it avoided five. A self-check locks that in.
The popup once read “Fraud (1850)” over ten blocks. Each incident is attached to every street near it, about 112 streets on average, so adding the counts along a route counted the same incident many times over. It now ranks the incident types by how many flagged blocks list them first, shows no count, and says why.
What the data can’t tell you
The score is built from incidents reported to the police, which is not the same as all crime. Some kinds of crime are reported less often than others, and reporting and policing differ between neighborhoods, so part of a street’s score reflects where reports were made. The red shading on the map shows where incidents were recorded. It says nothing about the people who live on those streets. The demo uses the score for one thing: comparing two routes for a single walk.
Status
Finished and online. Thirteen self-checks run inside the code: no test framework, just the smallest thing that fails if the logic breaks. The demo covers the area around Penn, where the data is.
Skills & tools
- Language
- Python
- Web app
- Flask, Folium, SQLite
- Data
- pandas / GeoPandas
- Routing
- NetworkX / OSMnx
- Method
- Percentile-rank normalization, comparing routes by high-risk blocks and high-risk meters