R/doc_utils.R

Defines functions doc_link doc_url

doc_url <- function(service) {
  url_template <- switch(
    service,
    directions = ,
    isochrones = ,
    matrix = ,
    snap = ,
    export =
      "https://openrouteservice.org/dev/#/api-docs/v2/%s/{profile}/post",
    pois = ,
    optimization =
      "https://openrouteservice.org/dev/#/api-docs/%s/post",
    "https://openrouteservice.org/dev/#/api-docs/%s"
  )
  sprintf(url_template, service)
}

doc_link <- function(service, label = service)
  sprintf("[%s](%s)", label, doc_url(service))

signup_url <- function (label) {
  url <- "https://openrouteservice.org/dev/#/signup"
  if (missing(label))
    url
  else
    sprintf("[%s](%s)", label, url)
}

Try the openrouteservice package in your browser

Any scripts or data that you put into this service are public.

openrouteservice documentation built on Oct. 21, 2024, 9:06 a.m.