Open Robinlovelace opened 2 weeks ago
Write a small function to obtain the cycle network for cities. rbind them to coherent network will make very scattered.
cycle_network = function(area, length_threshold = 100) {
osm = osmactive::get_travel_network("Scotland", boundary = area, boundary_type = "clipsrc")
cycle_net = osmactive::get_cycling_network(osm)
drive_net = osmactive::get_driving_network_major(osm)
cycle_net = osmactive::distance_to_road(cycle_net, drive_net)
cycle_net = osmactive::classify_cycle_infrastructure(cycle_net)
# filter cycle_net based on column bicycle is yes dismount adn designated
cycle_net = cycle_net |>
filter(bicycle == "yes" | bicycle == "dismount" | bicycle == "designated") # |> select(geometry)
cycle_net = cycle_net |>
mutate(length = as.numeric(sf::st_length(geometry)))
cycle_net_f = cycle_net |> filter(length > length_threshold)
return(cycle_net_f)
}
Looking good!
How does
cycle_net = cycle_net |>
filter(bicycle == "yes" | bicycle == "dismount" | bicycle == "designated") # |> select(geometry)
Differ from
cycle_net = cycle_net |>
filter(`Infrastructure type` == "Separated cycle track")
?
cycle_net = cycle_net |>
filter(bicycle == "yes" | bicycle == "dismount" | bicycle == "designated")
cycle_net = cycle_net |> filter(cycle_segregation == "Separated cycle track")
cycle_net_f = cycle_net |> filter(length > length_threshold = 300)
Looking good!
My take:
should we include the majority of these off-road cycleways (in blue)? Zhao has related questions in emails, sorry for all the volume of comms on this but feedback v. appreciated.
We should find a way to keep only the most important (those with continuous length above a threshold and with high potential) and simply add them onto the layer. Won't be perfect and may lead to some dangling edges but Zhao and I struggling. Food for thought in preparation for face-to-face meeting on Thursday I guess, we're close to diminishing returns in whack-a-mole but getting there.
Plan B: A more difficult approach: add parts of the OSM network that do not overlap with the OpenRoads dataset to the OpenRoads dataset as a pre-processing step. That would involve connecting the dangling and disconnected edges in OSM network with the nearest point (maybe nearest point in right direction) in the OpenRoads dataset before running the corenet method so the routing works.
I would go with Plan A first and see how it looks after removing the isolated cycleways.
Any update on this @wangzhao0217 ? I guess we can update the pmtiles after your changes.
Thoughts on how to do this:
The result should look like this: