Comparison Tool
An interactive web app for comparing Calculon vs Valhalla routing side by side.
Quick start
./tools/compare/run.sh
This starts three services:
| Service | Port | Description |
|---|---|---|
| Calculon | 8002 | Built and started from source |
| Valhalla | 8003 | Docker container (ghcr.io/valhalla/valhalla:latest) |
| Webapp | 9091 | Lit + MapLibre comparison UI |
Open http://localhost:9091 to start comparing.
Options
# Use Monaco tiles (smaller, ~32 km²)
./tools/compare/run.sh --tiles monaco
# Use France tiles (default)
./tools/compare/run.sh --tiles france
# Debug build (faster compilation, slower runtime)
./tools/compare/run.sh --debug
# Release build (default)
./tools/compare/run.sh --release
Tiles must exist at test_data/{name}_tiles/. Press Ctrl+C to stop all services.
Features
Route comparison
Click two points on the map to compute routes on both Calculon and Valhalla. The panel shows:
- Distance and time for each engine
- Percentage difference between the two
- Turn-by-turn maneuver list
Both routes are drawn on the map with distinct colors.
Matrix comparison
Switch to Matrix mode to compare many-to-many distance/time matrices. Each cell shows the difference between engines.
Verbose mode
Enable verbose mode to see per-edge cost breakdowns. Useful for diagnosing why Calculon picks a different path than Valhalla.
Graph inspection
Right-click a location to inspect the graph — shows all edges radiating from the nearest junction with their attributes.
URL state
Route coordinates, costing mode, and other settings are persisted in the URL. Share a link to reproduce a specific comparison.
Tech stack
| Layer | Technology |
|---|---|
| Components | Lit (web components) |
| Map | MapLibre GL |
| Build | Vite |
| Package manager | bun |
| Linting | Biome |
Development
cd tools/compare
bun install
bun run dev