AppVeyor Build Status


The goal of cyclestreets is to provide a simple R interface to the routing service.

It was split-out from stplanr for modularity.


Install the package with devtools as follows:

# install.packages("devtools")


A common need is to get from A to B:

library ("cyclestreets")
# stplanr::geo_code ("leeds rail station") 
from = c(-1.544, 53.794)
# stplanr::geo_code ("leeds university") 
to = c(-1.551, 53.807)
r = cyclestreets::journey(from, to, "balanced")

To get a key go to

Save the key as an environment varible using export CYCLESTREETS=your_key_here by adding CYCLESTREETS=your_key_here as a new line in your .Renviron file, e.g. with the following command:


Check the map is good with leaflet:

p = colorNumeric("RdYlBu", domain = r$busynance, reverse = TRUE)
leaflet(r) %>% 
  addTiles() %>% 
  addPolylines(color = ~p(busynance), weight = 20, opacity = 0.9) %>% 
  addLegend(pal = p, values = ~busynance)

Route types available are: fastest, quietest, balanced. See help pages such as ?journey and for details.

Try the cyclestreets package in your browser

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

cyclestreets documentation built on May 2, 2019, 5:41 a.m.