Closed Robinlovelace closed 1 month 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.
Progress on this: many of the off road cycleways are in there, but not connected, e.g.:
See https://nptscot.github.io/#/clos,coherentnetwork/#13.66/55.92349/-3.1323
Thoughts on how to 'join up' the network below...
Follow-up in conversation with @wangzhao0217 now.
Priority for this:
Source: https://www.tldraw.com/r/hoNxfsRTMB7W4rU2-O51v?v=0,-102,1920,947&p=page
Latest from @wangzhao0217 below, looking good:
Heads-up @wangzhao0217 after converting to sfnetworks object, degree()
should find those nodes, right? https://igraph.org/r/doc/degree.html
From conversation with @wangzhao0217 today:
Idea: add the off road paths earlier in the process so it's a pre-processing, not post-processing step.
This is done now, right @wangzhao0217 ? Another idea I'd like to discuss: classifying the cn by primary, secondary, etc.
Thoughts on how to do this:
The result should look like this: