Learn R Programming

osrm.backend

The goal of osrm.backend is to be a companion to {osrm} R package https://github.com/riatelab/osrm:

  • provide single line quick start with osmr_start() function that does everything automatically to run local OSRM backend server, no other setup is required;

  • easily install osrm.backend on major operating systems (Linux, Windows, MacOS);

  • provide wrapper functions to prepare data for osrm routing;

  • provide wrapper to start/stop local OSRM backend server.

Installation

Install the latest stable release of osrm.backend from CRAN with:

# soon on CRAN, watch this space!

You can install the development version of osrm.backend from R Universe with:

install.packages('osrm.backend',
 repos = c('https://e-kotov.r-universe.dev', 'https://cloud.r-project.org')
)

or from GitHub repo with:

# install.packages("pak")
pak::pak("e-kotov/osrm.backend")

You can prepare the OpenStreetMap data for routing with one function osrm_start(<path_to_osm_file_or_folder_with_osm_file>), set the osrm.server option to http://localhost:5001/ and use all the {osrm} functions as usual. You do not need to have osrm-backend installed or have Docker to run osrm-backend from a container, everything is handled automatically an all major operating systems. Just follow the Get started guide. For advanced control over each step of the process, see the full function reference.

Copy Link

Version

Install

install.packages('osrm.backend')

Version

0.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Egor Kotov

Last Published

December 7th, 2025

Functions in osrm.backend (0.1.1)

osrm_prepare_graph

Prepare OSRM Graph for Routing (Extract + Partition/Contract)
osrm_servers

List OSRM servers started via this package
osrm_stop

Stop an OSRM Server
osrm_which

Locate the OSRM Installation Used by osrm.backend
osrm_uninstall

Uninstall OSRM Backend Binaries
osrm_start

Start an OSRM Server with Automatic Setup
osrm_start_server

Start an OSRM MLD/CH server with osrm-routed
osrm_stop_all

Stop all running OSRM servers started via this package
osrm_find_profile

Locate an OSRM Lua profile (e.g. car.lua) in a host installation
osrm_customize

Customize OSRM Graph for Multi-Level Dijkstra (MLD)
osrm_contract

Contract OSRM Graph for Contraction Hierarchies (CH)
osrm_cleanup

Clean Up OSRM Files in a Directory
osrm_check_available_versions

Check for Available OSRM Versions
osrm_install

Install OSRM Backend Binaries
osrm_clear_path

Clear OSRM Path from Project's .Rprofile
osrm_extract

Extract OSM into OSRM Graph Files
osrm_check_latest_version

Check for the Latest Stable OSRM Version
osrm_partition

Partition OSRM Graph for Multi-Level Dijkstra (MLD)