R interface to the CycleStreets.net LTN. See API docs.
ways(
bb,
pat = Sys.getenv("CYCLESTREETS"),
base_url = "https://api.cyclestreets.net/v2/mapdata?",
limit = 400,
types = "way",
wayFields =
"name,ridingSurface,id,cyclableText,quietness,speedMph,speedKmph,pause,color",
zoom = 16
)
An sf or 'bounding box' like object
The API key used. By default this uses Sys.getenv("CYCLESTREETS")
.
The base url from which to construct API requests (with default set to main server)
Maximum number of features to return
The type of way to get. Default: "way".
Which attributes of the ways to return?
Zoom level
if (FALSE) { # \dontrun{
u_test = paste0("https://api.cyclestreets.net/v2/mapdata?key=c047ed46f7b50b1x",
"&limit=400&types=way&wayFields=name,ridingSurface,id,cyclableText,",
"quietness,speedMph,speedKmph,pause,color&zoom=16&",
"bbox=-9.160863,38.754642,-9.150128,38.75764")
# ways_test = sf::read_sf(u_test)
bb = "0.101131,52.195807,0.170288,52.209719"
bb = "-9.160863,38.754642,-9.150128,38.75764"
way_data = ways(bb)
plot(way_data)
bb = stplanr::routes_fast_sf
way_data = ways(bb)
plot(way_data)
} # }