Open Source Routing Machine (OSRM)
High performance routing engine designed to run on OpenStreetMap data and offering an HTTP API, C++ library interface, and Nodejs wrapper.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Overview
OSRM (Open Source Routing Machine) is an open-source routing engine written in modern C++ that calculates shortest paths in road networks. It imports OpenStreetMap (OSM) data directly and can handle continent-scale road networks, with query response times in the millisecond range. The project is released under the permissive Simplified 2-Clause BSD License, so it is free to use in both commercial and non-commercial projects.
The project provides an online demo map (map.project-osrm.org) and full documentation. The source code is hosted on GitHub in the Project-OSRM/osrm-backend repository.
Key Features
- OSM data import: Flexibly imports OpenStreetMap data so you can build your own road network.
- Fast queries: Optimized for large road networks; even continent-wide routes can be calculated in milliseconds.
- Multiple modes of travel: Supports driving, cycling and walking.
- Custom rules via profiles: Adjust routing rules through profiles, such as road preferences, speeds and access restrictions, to fit different scenarios.
- HTTP API: Provides route calculation and other services over HTTP, making it easy to integrate into web applications or backend systems.
Target Users and Use Cases
- Developers and companies that need to host their own navigation or routing service
- Logistics, delivery and mobility applications that need to calculate large numbers of routes and travel times
- GIS researchers and data analysts working on accessibility or transport network analysis
- Teams that want to replace commercial routing APIs, reduce costs or keep control of their data
Core Strengths
- High performance: Responds in milliseconds even on large road networks, making it suitable for high-concurrency production environments.
- Open source with a permissive license: The BSD-2-Clause license imposes almost no restrictions on use.
- Open data: Based on OpenStreetMap, with no reliance on proprietary map data.
- Customizable: Profiles let you adjust the routing logic.
Deployment
OSRM can be compiled from source (C++) or deployed using the Docker images provided by the community and the project itself. A typical workflow looks like this:
- Download OpenStreetMap data for your target region (in
.osm.pbfformat); - Preprocess the data with the OSRM toolchain and a profile for your chosen mode of travel (such as car, bicycle or foot);
- Start the routing service and query it over the HTTP API.
For specific commands and parameters, see the official documentation (project-osrm.org/docs/) and the GitHub repository instructions.
Technical Requirements
- An environment that can compile C++, or the ability to run Docker
- Preprocessing large map datasets (such as an entire continent) requires considerable memory and disk space, depending on the size of the data
Community
You can reach the project community through the Discord server, the OSM mailing list (osrm-talk) and Mastodon.
Discover more
TileServer GL
Vector and raster maps with GL styles. Server side rendering by Mapbox GL Native. Map tile server for Mapbox GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
AdventureLog
Travel tracker and trip planner.
AirTrail
Personal flight tracking system.
Bicimon
Bike Speedometer as Progressive Web App.
Dawarich
Visualize your location history, track your movements, and analyze your travel patterns with complete privacy and control (alternative to Google Timeline a.k.a. Google Location History).
FitTrackee
Self-hosted outdoor activity tracker :bicyclist: [mirror of codeberg repository: https://codeberg.org/FitTrackee/FitTrackee]