PathSafe

PathSafe scores walking routes 0-100 on lighting, sidewalks, traffic exposure and reported hazards, then shows exactly why one route beat another.

What it does

Ordinary navigation optimises for a single variable: time. PathSafe retrieves several walking options between two points, scores each from 0 to 100, and — the part that matters — shows exactly why one route scored higher than another.

Enter a start and destination and you get three walking options, each with a time, a distance and a Safety Awareness Score. Select one and you see the full breakdown: four factors, each with a rating and a plain sentence naming the measurement behind it. Click the map to report a hazard — pick a category, set severity, drag the pin — and the routes re-rank instantly.

The Safety Awareness Score

Every route begins at 100 and loses weighted points across four factors.

totalScore = 100 − Σ penalty
penalty    = (100 − subScore) × weight
Factor Day Night Measured from
Reported hazards 35% 30% User reports, by severity and distance from the route
Sidewalk coverage 25% 20% Route length on footways, paths and cycleways
Major-road exposure 25% 20% Route length within 25 m of a mapped arterial
Lighting coverage 15% 30% Mapped street lamps per kilometre

A hazard counts at full strength within 60 m of the route and fades to zero at 150 m. Twenty-five lamps per kilometre — roughly one every 40 m — reads as fully lit.

Weights track both safety relevance and data reliability. Lighting is the least reliably mapped factor, so it carries the least weight by day and the most after dark, when it matters most.

Why the number can be trusted

The model is a small deterministic function. There is no machine learning, and no AI anywhere in the scoring path.

Each factor returns its sub-score and the sentence that describes it, both built from the same measurement. There is no second code path that could let the explanation drift from the number. A unit test asserts that the total equals 100 minus the sum of the displayed penalties — that test is what guarantees the on-screen breakdown genuinely explains the on-screen score.

Where OpenStreetMap has nothing mapped, or a data service fails, the affected factor is marked Limited data, its weight is redistributed proportionally across the remaining factors, and the total still sums correctly. Nothing is guessed or filled in.

How it is built

Next.js, React and TypeScript, with MapLibre GL JS for the map. Every external service is free and requires no payment details:

  • OpenFreeMap — map tiles, no API key or signup
  • openrouteservice — walking routes and road-class data
  • Photon — address search
  • Overpass — street lamps and arterial geometry

There is no database; hazard reports are held in the browser. The application has one runtime dependency and roughly 3,400 lines of code.

Users can optionally answer three questions — when they walk, which factor matters most, and their preferred units — which adjust the weights. No account is required, and the interface shows the resulting percentages updating live as the questions are answered. Night mode darkens the whole interface and the map, and doubles the weight on lighting.

Scope and limitations

  • PathSafe describes mapped infrastructure and user-submitted hazard reports. It is not a safety guarantee.
  • The score makes no claim about any place, neighbourhood, or the people in it.
  • Lighting and arterial data quality varies by city. Where coverage is thin, the application says so rather than estimating.
  • The weights are a defensible starting point, not a validated safety model.
Share this project:

Updates

Submission history