Replace the haversine straight-line estimate with real road travel times from a self-hosted OSRM (free/offline — Mapbox Matrix is billable). - hub: osrmMatrix() calls OSRM /table for the job+home coords (node order matches route_solver: jobs then homes), returns a minutes matrix. Handles PARTIAL coords — OSRM for geolocated nodes, 0/neutral for the rest (matches the solver's own fallback), so a few tech homes without coords don't disable OSRM for the geolocated majority. /roster/ optimize-routes injects body.matrix; graceful fallback to haversine if OSRM is unreachable or too few points. - config: OSRM_URL (default http://osrm:5000). - services/osrm/README.md: reproducible setup (Québec extract, MLD pipeline, osrm-routed on erpnext_erpnext network). Deployed + verified: OSRM /table hit with the full coord set, no fallback; optimizer routes on real road times. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| data | ||
| docs | ||
| lib | ||
| preview | ||
| public | ||
| scripts | ||
| templates | ||
| test | ||
| .env.example | ||
| docker-compose.yml | ||
| package-lock.json | ||
| package.json | ||
| server.js | ||