How gnarendra9014-user/map-routing works
Map Router turns OpenStreetMap road data into a routable graph, then answers route queries through a CLI or embedded HTTP server. The browser provides the interactive map and routing experience, calling same-origin endpoints for routes, waypoint optimization, and network data. Its documented capabilities also include algorithm comparison, tours, overlays, elevation, and export. The graph reflects sampled parser, algorithm, and frontend/API evidence; some UI features are documented but their implementation details were not sampled, so their internal wiring is omitted.
Main entry points: main.cpp CLI and HTTP server · app.js Map interface · types.hpp Route result · osm_parser.cpp OSM parser
Components 26
Browser experience
- Map interface
web/app.js - GPX and sharing
web/app.js - Comparison and diagnostics
web/app.js - 3D tour and guidance
web/app.js - Traffic and overlays
web/app.js - Elevation profile
web/app.js
Road data
- OSM parser
src/osm_parser.cpp - Road data
include/osm_parser.hpp - Road graph
src/graph.cpp - Serialized graph
include/graph.hpp
Routing engine
- Dijkstra
src/dijkstra.cpp - A*
src/astar.cpp - Bidirectional A*
src/bidirectional_astar.cpp - CH query
src/ch.cpp - Route result
include/types.hpp
Query preprocessing
- CH preprocessing
src/ch.cpp - ALT preprocessing
src/alt.cpp - Hub labeling
src/hub_labeling.cpp - ALT data
include/alt.hpp - CH data
include/ch.hpp
CLI and HTTP
- CLI and HTTP server
tools/main.cpp - Waypoint optimizer
tools/main.cpp - GeoJSON export
src/geojson.cpp
Other components
- Traveler
- MapLibre tiles
- OSM PBF
Connections 33
- Traveler → Map interface: sets route
- Map interface → MapLibre tiles: renders map
- OSM PBF → OSM parser: supplies data
- OSM parser → Road data: extracts roads
- Road data → Road graph: builds graph
- CLI and HTTP server → OSM parser: parses input
- CLI and HTTP server → Road graph: builds graph
- CLI and HTTP server → Serialized graph: loads or saves
- Road graph → Serialized graph: serializes
- CLI and HTTP server → Dijkstra: dispatches query
- CLI and HTTP server → A*: dispatches query
- CLI and HTTP server → Bidirectional A*: dispatches query
- CLI and HTTP server → CH query: dispatches query
- Dijkstra → Route result: returns route
- A* → Route result: returns route
- Bidirectional A* → Route result: returns route
- CH query → Route result: returns route
- CLI and HTTP server → CH preprocessing: builds hierarchy
- CLI and HTTP server → ALT preprocessing: builds landmarks
- CH preprocessing → CH data: saves hierarchy
- CLI and HTTP server → CH data: loads hierarchy
- ALT preprocessing → ALT data: saves landmarks
- CLI and HTTP server → ALT data: loads landmarks
- Hub labeling → CH data: uses hierarchy
- Map interface → CLI and HTTP server: requests routes
- Map interface → CLI and HTTP server: optimizes stops
- CLI and HTTP server → Waypoint optimizer: dispatches optimization
- Map interface → Comparison and diagnostics: shows metrics
- Map interface → 3D tour and guidance: plays route tour
- Map interface → Traffic and overlays: displays overlays
- Map interface → Elevation profile: displays profile
- Map interface → GPX and sharing: exports or shares
- Route result → GeoJSON export: formats route