Bindings for 'Open Source Routing Machine'

Install and control 'Open Source Routing Machine' ('OSRM') backend executables to prepare routing data and run/stop a local 'OSRM' server. For computations with the running server use the 'osrm' package for 'R' (< https://cran.r-project.org/package=osrm>).


osrm.backend r5rgui website

Lifecycle:experimental CRANstatus CRAN/METACRAN Total downloads CRAN/METACRAN Downloads per month osrm.backend statusbadge OSRM tested(Linux) OSRM tested(macOS) OSRM tested(Windows) R-CMD-check pkgcheck Codecov testcoverage

DOI

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 osrm_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.

OSRM backend binaries

By default, osrm.backend installs OSRM from e-kotov/osrm-binaries. These are immutable OSRM backend binary releases built from upstream OSRM source tags primarily for this R package.

The default binary releases are different from the official upstream OSRM release assets:

  • they contain backend command-line executables such as osrm-extract, osrm-contract, osrm-customize, osrm-partition, and osrm-routed;
  • they do not include upstream node_osrm Node.js package artifacts;
  • they use predictable archive names for Linux, macOS, and Windows;
  • they bundle runtime libraries where practical, so the archives are more portable for R users than relying on a local OSRM build toolchain;
  • they are live-tested by this package on Linux, Linux arm64, macOS, and Windows.

The official upstream binaries from Project-OSRM/osrm-backend are still available with:

osrm_install(osrm_binaries_provider = "official")

That provider is kept as a compatibility option. The main supported and tested installation path is the default e-kotov/osrm-binaries provider. See the OSRM binary providers vignette for details.

Installation

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

install.packages("osrm.backend")

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 on all major operating systems. Just follow the Get started guide. For advanced control over each step of the process, see the full function reference.

OSRM Graphical User Interface demo

osrm GUI demo1

osrm GUI demo2

osrm GUI demo3

Auto-tested OSRM releases (generated)

OSBadgeValidated releasesNotes
LINUXLINUX badgev26.9.0, v26.8.0, v26.7.3, v26.7.2, v26.7.1, v26.7.0, v26.6.5, v26.6.4, v26.6.3, v26.6.2, v26.6.1, v26.6.0, v26.5.0, v26.4.1, v26.4.0, v6.0.0, v5.27.1v5.27.1 - v26.9.0
MACOSMACOS badgev26.9.0, v26.8.0, v26.7.3, v26.7.2, v26.7.1, v26.7.0, v26.6.5, v26.6.4, v26.6.3, v26.6.2, v26.6.1, v26.6.0, v26.5.0, v26.4.1, v26.4.0, v6.0.0, v5.27.1v5.27.1 - v26.9.0
WINDOWSWINDOWS badgev26.9.0, v26.8.0, v26.7.3, v26.7.2, v26.7.1, v26.7.0, v26.6.5, v26.6.4, v26.6.3, v26.6.2, v26.6.1, v26.6.0, v26.5.0, v26.4.1, v26.4.0, v6.0.0, v5.27.1v5.27.1 - v26.9.0

Badge source: badges branch — raw JSON files (e.g. osrm_versions_ubuntu.json).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("osrm.backend")

0.4.1 by Egor Kotov, 2 months ago


https://github.com/e-kotov/osrm.backend, https://www.ekotov.pro/osrm.backend/


Report a bug at https://github.com/e-kotov/osrm.backend/issues


Browse source code at https://github.com/cran/osrm.backend


Authors: Egor Kotov [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports digest, httr2, jsonlite, lifecycle, processx, ps, viridisLite

Suggests DT, knitr, mapgl, osrm, rmarkdown, sf, shiny, testthat, tibble, withr

System requirements: OSRM backend binaries (>= v5.27.0); package downloads binaries automatically from <https://github.com/e-kotov/osrm-binaries> by default; upstream OSRM binaries from <https://github.com/Project-OSRM/osrm-backend> are available as an optional provider


See at CRAN