Interface Between R and the OpenStreetMap-Based Routing Service Valhalla
Valhalla is a routing service that is based on OpenStreetMap data. This package provides an interface to the Valhalla API from R. It allows you to query the Valhalla API for routes, isochrones, time-distance matrices, nearest point on the road network, and elevation data.
This package relies on the usage of a running Valhalla service (tested with v3.4.x-3.5.x of Valhalla).
vl_route()
: Get route between locations.vl_matrix()
: Get travel time matrices between points.vl_locate()
: Get the nearest point on the road network.vl_elevation()
: Get elevation data at given location(s).vl_isochrone()
: Get isochrone polygons.vl_optimized_route()
: Get optimized route between locations.vl_status()
: Get information on Valhalla service.# install.packages("remotes")
remotes::install_github("riatelab/valh")
The package is designed to provide an easy-to-use interface to the
Valhalla routing service from R. Special care has been taken to support
multiple input formats, and the package treats sf
objects as
first-class citizens in both input and output. Additionally, we have
tried to maintain a minimal number of dependencies.
This package offers an API that closely resembles that of the
osrm
package which provides an R
interface to the OSRM routing service.
Note that there are other packages that provide an interface to Valhalla API from R :
valhallr: This
package is on CRAN, but only allows you to access to some Valhalla
services (height, locate and optimized route are notably
absent). In addition, it calls on many heavy dependencies to install,
whereas valh
is particularly light on dependencies. Finally, it
doesn’t allow you to work directly with sf
objects as input.
rvalhalla: This package
is not on the CRAN, and while it provides access to various Valhalla
services, it only does the heavy lifting needed to easily use the data
for two of the services (route and sources_to_target). In
addition, it doesn’t allow you to work directly with sf
objects as
input.
One can contribute to the package through pull requests and report issues or ask questions here. See the CONTRIBUTING.md file for detailed instructions.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.