A C interface for OSRM (Open Source Routing Machine), a high-performance tool for route planning in road networks. The API aims to be feature complete, except for the output format, which is restricted to FlatBuffers.
Originally forked from Daniel Hofmann's libosrmc, this version has been substantially refactored to facilitate the development of OpenSourceRoutingMachine.jl.
- OSRM 6.0: OSRM
- C++20 compiler: GCC 10+ or Clang 12+
- pkg-config: For locating OSRM configuration
Supported platforms: Linux, macOS, Windows (MinGW)
libosrmc uses aligned versioning with OSRM: libosrmc X.Y.Z requires OSRM X.Y. Patch versions are independent and indicate interface-only changes.
cd libosrmc/libosrmc
make
sudo make installCustom installation path:
make PREFIX=/custom/path
sudo make install PREFIX=/custom/pathFor usage examples, see the OpenSourceRoutingMachine.jl package.
libosrmc provides access to six OSRM services:
- Nearest: Find the nearest waypoint in a road network for a given position
- Route: Find routes between waypoints
- Table: Find travel matrices between multiple source and destination waypoints
- Match: Find a route by map matching noisy GPS traces to a road network
- Trip: Find a route by solving the traveling salesman problem
- Tile: Retrieve road network geometry as vector tiles
All services, except the Tile service, return output in FlatBuffers format. The Tile service returns road network geometry in MVT format.
The code is tested through the Julia package OpenSourceRoutingMachine.jl.
Copyright (c) 2025 MOVIRO GmbH, Daniel J. Hofmann and contributors
Licensed under the MIT License.