R-CMD-check Coverage Status lifecycle CRAN checks CRAN release CRAN downloads

openrouteservice R client

lines = readLines("vignettes/openrouteservice.Rmd")
ids = grep("<!-- README (START|END) -->", lines) + c(1, -1)
readme = lines[do.call(":", as.list(ids))]
readme = gsub("^#(#+)(.*)", "\\1\\2", readme)
cat(knitr::knit_child(text=readme, quiet=TRUE))

Get started

See the package vignette for an overview of the offered functionality.

Local ORS instance

The default is to fire any requests against the free public services at . In order to query a different openrouteservice instance, say a local one, set

options(openrouteservice.url = "http://localhost:8082/ors")

If necessary, endpoint configuration can be further customized through openrouteservice.paths which specifies a named list of paths. The defaults are equivalent of having

opts_str <- "options(openrouteservice.paths = %s)"
nch <- nchar(opts_str) + 1L
ors_paths <- unlist(strsplit(deparse(openrouteservice:::ors_path(), 500L), ","))
indent <- paste0(rep(" ", nch), collapse="")
cat(sprintf(opts_str, paste0(ors_paths, collapse = paste(",", indent, sep="\n"))))
options(openrouteservice.path = list(directions = "v2/directions"))

Package news

lines = readLines("NEWS.md")
lines = gsub("^# openrouteservice (.*)", "# version \\1", lines)
versions = grep("^# ", lines)
## select only n latest news
n = 4
from = 1
to = if (length(versions) > n) versions[n+1]-1 else length(lines)
news = lines[from:to]
news = gsub("^(#+)(.*)", "##\\1\\2", news)
cat(paste(news, collapse = "\n"))

Publications using openrouteservice R package

Please feel free to reach out if you would like to have your work added to the list below.

lines = readLines("references.md")
lines = gsub('^<span class="csl-left-margin">', '', lines)
lines = gsub('^</span><span class="csl-right-inline">', '', lines)
lines = gsub(' </span>$', '', lines)
cat(paste(lines, collapse = "\n"))


GIScience/openrouteservice-r documentation built on Feb. 11, 2025, 1:28 p.m.