We’re pleased to announce the availability of a new CycleStreets R package that enables easy access to our routing API.

It enables R programmers to calculates cyclable routes in a reproducible command line interface, and obtain detailed metadata, e.g. quietness, elevation change, etc.


Quietness values within a route. See an interactive version of this map, showing all variables per segment.

For example, a common need is to get from A to B:

install.packages("cyclestreets")
# NB Ensure your key is in your environment, e.g. `export CYCLESTREETS=your_key_here`
library ("cyclestreets")
from = c(-1.544, 53.794)
to = c(-1.551, 53.807)
r = cyclestreets::journey(from, to, "balanced")
sf:::plot.sf(r)

An API key is required to enable the package to make use of the routing API, as with any client.

An overview of the package, providing documentation and exaples, is available at https://rpackage.cyclestreets.net/.

We have long seen interest in our route API from academic users, and we very much hope this R package will help further research work. An example is this, a 100% reproducible paper:

Desjardins E, Higgins CD, Scott DM, Apatu E, Paez A (2020) Correlates of bicycling trip flows in Hamilton, Ontario: fastest, quietest, or balanced routes? Transportation. doi:10.1007/s11116-021-10197-1.

Thanks to lead developer, Robin Lovelace, of Leeds University, who is the lead author and maintainer of the package.

Leave a comment