::install_github("nptscot/osmactive", dependencies = TRUE)
remotes::install_cran("osmextract") remotes
Classifying OSM Data
library(osmactive)
library(dplyr)
library(tmap)
tmap_mode("view")
= stplanr::route(
study_area_route from = "Glasgow Queen Street, Glasgow",
to = "University of Glasgow, Glasgow",
route_fun = stplanr::route_osrm
)= stplanr::line2points(study_area_route) |>
study_area_line mutate(id = 1:2) |>
::points_to_odl() |>
odslice(2)
= sf::st_buffer(study_area_line, dist = 1000) |>
study_area ::ms_simplify()
rmapshaper= sf::st_union(study_area) study_area
tm_shape(study_area) +
tm_borders() +
tm_shape(study_area_route) +
tm_lines(lwd = 2, col = "red")
= get_travel_network(
osm
study_area,boundary = study_area,
boundary_type = "clipsrc"
)= get_cycling_network(osm)
cycle_net = get_driving_network(osm)
drive_net = get_cycling_network(osm)
cycle_net = get_driving_network_major(osm)
drive_net = distance_to_road(cycle_net, drive_net)
cycle_net = classify_cycle_infrastructure(cycle_net)
cycle_net = plot_osm_tmap(cycle_net) m
m
And as a static image:
tmap_mode("plot")
m