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

Open Robinlovelace opened 2 weeks ago

Robinlovelace commented 2 weeks ago

Thoughts on how to do this:

The result should look like this:

image

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

image

Robinlovelace commented 2 weeks ago

Looking good!

Robinlovelace commented 2 weeks 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 2 weeks 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 2 weeks ago

image

Robinlovelace commented 2 weeks ago

Looking good!

Robinlovelace commented 2 weeks 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 2 weeks 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 2 weeks ago

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

Robinlovelace commented 6 days ago

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