Routing Engine For Openstreetmap data. Supports fast traffic updates and most types of turn restrictions (via-node, via-way, multiple via-way) from OpenStreetMap.
You can download OpenStreetMap data from geofabrik (https://download.geofabrik.de/index.html).
For this quick start, you can download this OSM map data.
pip install gdown
gdown https://drive.google.com/uc?id=1uBoFWUSRka9pqH2dVPKpcystxXmkkSgs --output ./data
This is optional and serves to accelerate the query engine. For this quick start, we will use Profile Guided Optimization ([PGO]).
gdown https://drive.google.com/uc?id=1HBswl5-JkFXWh--AFLC2ElYC4Tbsj1i0 --output ./data
gdown https://drive.google.com/uc?id=1pRmqUFgNc_p0lEKmfzLcn3IRhUW4Cm4c --output ./data
sh scripts/build_pgo.sh
run a preprocessing phase to speed up point-to-point fastest path queries. In the current implementation, only the Customizable Route Planning (CRP) ([1], [6]) algorithm is available. The CRP pre-processing phase creates multilevel partitions using Inertial Flow Algorithm ([4]) and overlay graph data structures.
go build -o ./bin/preprocessor ./cmd/preprocessor
./bin/preprocessor
The Customizable Route Planning CRP customization phase ([1], [6]) computes the shortcut weights at each cell of the multilevel partitioning result. The customizer also computes landmark distances for the ALT algorithm (A* Search, Landmarks, and Triangle Inequality) ([3]).
go build -o ./bin/customizer ./cmd/customizer
./bin/customizer
The point-to-point fastest path query, similar to the one in ref ([5]), running Bidirectional ALT (A* Search, Landmarks, and Triangle Inequality) ([3]) on the graph consisting of the union of overlay Graph, C_s , and C_t . (Here C_v denotes the subgraph of G induced by the vertices in the cell containing v.), resulting from the preprocessing and customization phases of the Customizable Route Planning (CRP) ([1], [6]) technique.
go build -o ./bin/engine -pgo=./bin/default.pgo ./cmd/engine
./bin/engine
If you have real-time traffic data, you can also update the weights of the affected road segments (edges) while the query engine is running.
example:
./bin/customizer --segment-speed-file=./data/traffic_solo.csv,./data/blokade_solo.csv
For changes in the duration (weight) of road segments, the csv file follows the following format:
from_osm_id, to_osm_id, road_segment_speed_in_km_h
from/to OSM node IDs are OpenStreetMap Node Id.from/to OSM node IDs must be connected. Note that for some OSM nodes that only have indegree and outdegree equal to 1, the node may be compressed/contracted so that only the two adjacent nodes to the contracted node remain in the compressed graph.
After you run the command above, the query engine will provide the following log:
2026-10-01T11:04:36.432041559+07:00 info engine.checkCustomizerUpdate: metrics file modification time changed old=2026-10-01 11:03:58 WIB new=2026-10-01 11:04:35 WIB. updating the metrics...
2026-10-01T11:04:36.623123575+07:00 info engine.checkCustomizerUpdate: the metrics was successfully updated.
navigatorx also supports updating turn penalties with the customizer cmd flag "--turn-penalty-file", whose csv file follows the following format:
from_osm_id, via_osm_id, to_osm_id, turn_penalty_in_seconds
gdown https://drive.google.com/uc?id=1HBswl5-JkFXWh--AFLC2ElYC4Tbsj1i0 --output ./data
gdown https://drive.google.com/uc?id=1pRmqUFgNc_p0lEKmfzLcn3IRhUW4Cm4c --output ./data
sh ./scripts/run_test.sh
load tests result: https://github.com/lintang-b-s/skripsi_code
The OpenAPI specification is available at swagger.yaml.
nextjs frontend demo: navigatorx-crp-fe
online routing engine demo: demo
1.Delling, D., Goldberg, A. V., Pajor, T., dan Werneck, R. F. (2015). Customizable Route Planning in Road Networks. Transportation Science, No. 2, Volume 51, pages 566-591
2. Abraham, I., Delling, D., Goldberg, A. V., Werneck R. F. (2010) “Alternative Routes in Road Networks,” in P. Festa (ed.) Experimental Algorithms. Berlin, Heidelberg: Springer, pp. 23–34. Available at: https://doi.org/10.1007/978-3-642-13193-6_3 .
3. Goldberg, A. and Harrelson, C. (2005) “Computing the shortest path: A* search meets graph theory,” in. ACM-SIAM Symposium on Discrete Algorithms. Vancouver: ACM, pp. 156 - 165.
4. Schild, A. and Sommer, C. (2015) ‘On Balanced Separators in Road Networks’, in E. Bampis (ed.) Experimental Algorithms. Cham: Springer International Publishing, pp. 286–297.
5. Efentakis, A., Pfoser, D. dan Vassiliou, Y. (2015). SALT. A Unified Framework for All Shortest-Path Query Variants on Road Networks. In Proceedings of the 14th International Symposium on Experimental Algorithms, Volume 9125, pages 298–311, Paris.
6. Delling, D., Goldberg, A. V., Pajor, T., dan Werneck, R. F. (2011). Customizable Route Planning. In: Pardalos, P.M., Rebennack, S. (eds) Experimental Algorithms, Volume 6630. Springer, Berlin, Heidelberg.
i would like to express my deepest gratitude to the contributors to the open source projects below. The code in the Navigatorx project is heavily adapted and inspired by the following open source projects:
This project is licensed under the MIT License - see the LICENSE file for details.