Leaflet + OpenStreetMap/OpenTopoMap for the map, OpenRouteService for live walking alternatives & elevation — no Google dependency
You're opening this file directly from disk (file://). Browsers send no usable origin for
file:// pages, and most public APIs — including OpenRouteService, Nominatim, and SFPD's data
portal — reject that for security reasons. That means every button below that fetches live data
(Fetch live alternatives, Fetch safety data, + New project) will fail here, even with a valid key.
The curated Precita Ave → Whole Foods project will still work fully offline.
To use live fetching: serve this folder over http instead of double-clicking the file — e.g. open
a terminal in this file's folder and run python3 -m http.server 8000, then
visit http://localhost:8000/ and open the file from there. Any static file
host (GitHub Pages, Netlify, etc.) works too.
Project
Reference plan
Route library
Weighting scenarios
Tick which scenarios this project considers; the ticked set becomes the chip buttons under the diagram. Presets are locked (their weights aren't editable) — "Copy" one to get an editable custom scenario. Same principle as the interchange Workbench's scenario library: there it blended Level / Weather / Quality; here it blends Grade / Shadow / Safety.
Weather & shade protection placeholder
Not yet scored. Planned: sun-position (time of day/date) × building-height shadow casting along each segment, plus tree canopy where mapped — see project notes. The "Shadow" weight in Weighting scenarios above is already live and ready for it.
Personal security crime live · lighting/frontage pending
Crime is now fetched live from SFPD Incident Reports (last 365 days, 120m radius per segment sample point; categories: Assault, Robbery, Homicide, Sex Offense, Weapons Offense). Lighting and Frontage still have no verified live source — DataSF's obvious "streetlights" dataset turned out to be 311 outage complaints, not a coverage inventory, so it's excluded rather than used as a misleading proxy. Set a source's weight to 0 to exclude it entirely.
Path & surface quality placeholder
Not yet scored. Planned: sidewalk presence/width, surface type (paved/unpaved/informal steps), and crossing exposure (signalized vs. unsignalized, traffic volume) per segment.
Within-parameter basis (v1/v2) placeholder
Cross-parameter weighting (Grade / Shadow / Safety) is live now via Weighting scenarios above. What's still fixed: within the Grade parameter, segment scores always blend at 0.5×distance-prorated + 0.5×weakest-link. Planned: the same editable v1/v2 toggle and min-shares as the interchange Workbench, per parameter.
OpenRouteService key
Free signup, no credit card: openrouteservice.org/dev/#/signup. Kept only in this browser (localStorage), never sent anywhere but ORS.
Method note
Per-segment Grade score: Tobler's hiking function (1993) for ordinary sloped sidewalk — continuous, no artificial bands, fastest around -5% descent, slower in both directions beyond that, capped at 100 (no bonus past neutral). Segments over 20% grade are treated as stairs-equivalent (pending real stairs data) and scored instead via the interchange Workbench's discrete threshold formula. Route-level score blends the distance-weighted average with the single worst segment (weakest-link) — still meaningful since a stairs segment is a forced obstacle within that route, even though ordinary grade no longer works that way. Live routes are resampled to ~25m steps before scoring, to smooth GPS/DEM noise.