nptscot / npt

Data processing code, also use this repo for issue tracking for the Network Planning Tool. See https://nptscot.github.io for development version
https://www.npt.scot/
GNU Affero General Public License v3.0
5 stars 0 forks source link

Add off road cycleways to Coherent network #502

Closed Robinlovelace closed 1 month ago

Robinlovelace commented 5 months ago

Thoughts on how to do this:

The result should look like this:

image

wangzhao0217 commented 5 months 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)
}

image

Robinlovelace commented 5 months ago

Looking good!

Robinlovelace commented 5 months ago

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")

?

wangzhao0217 commented 5 months ago

cycle_net = cycle_net |> filter(bicycle == "yes" | bicycle == "dismount" | bicycle == "designated") image

cycle_net = cycle_net |> filter(cycle_segregation == "Separated cycle track") image

cycle_net_f = cycle_net |> filter(length > length_threshold = 300) image

wangzhao0217 commented 5 months ago

image

Robinlovelace commented 5 months ago

Looking good!

Robinlovelace commented 5 months ago

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.

Robinlovelace commented 5 months ago

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.

Robinlovelace commented 5 months ago

I would go with Plan A first and see how it looks after removing the isolated cycleways.

Robinlovelace commented 4 months ago

Any update on this @wangzhao0217 ? I guess we can update the pmtiles after your changes.

Robinlovelace commented 3 months ago

Progress on this: many of the off road cycleways are in there, but not connected, e.g.:

image

See https://nptscot.github.io/#/clos,coherentnetwork/#13.66/55.92349/-3.1323

Thoughts on how to 'join up' the network below...

Robinlovelace commented 3 months ago

Follow-up in conversation with @wangzhao0217 now.

Priority for this:

image

Source: https://www.tldraw.com/r/hoNxfsRTMB7W4rU2-O51v?v=0,-102,1920,947&p=page

Robinlovelace commented 3 months ago

Latest from @wangzhao0217 below, looking good:

image

Robinlovelace commented 3 months ago

Heads-up @wangzhao0217 after converting to sfnetworks object, degree() should find those nodes, right? https://igraph.org/r/doc/degree.html

Robinlovelace commented 3 months ago

From conversation with @wangzhao0217 today:

image

Idea: add the off road paths earlier in the process so it's a pre-processing, not post-processing step.

Robinlovelace commented 1 month ago

This is done now, right @wangzhao0217 ? Another idea I'd like to discuss: classifying the cn by primary, secondary, etc.