Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next steps on network simplification #291

Closed
6 of 10 tasks
Robinlovelace opened this issue Oct 1, 2023 · 5 comments · Fixed by #296
Closed
6 of 10 tasks

Next steps on network simplification #291

Robinlovelace opened this issue Oct 1, 2023 · 5 comments · Fixed by #296
Assignees

Comments

@Robinlovelace
Copy link
Contributor

Robinlovelace commented Oct 1, 2023

We now have a prototype simplified network, as described here: nptscot/networkmerge#58

I'm opening this issue here because ultimate the code that builds the simple network will live in this repo, tests in .R, .Rmd, or .qmd files can go in the code/tests folder.

Next steps that come to mind:

  • Try installing R 'build tools' to get dev versions of stplanr and rsgeo
  • Re-join for a small random sample across Scotland, using the new crs = "EPSG:27700" argument of rnet_merge() (this may depend on upstream changes in stplanr, see bug in geo_buffer ropensci/stplanr#538 and Bug in line_segment() when using certain values on projected data with rsgeo implementation ropensci/stplanr#546 )
  • Try rnet_merge() on projected data, with x and y in EPSG 27700 CRS
  • Try doing simplification only on certain segments, e.g. those on which cycling under the Go Dutch scenario is greater than some threshold (e.g. 500) and segments within a threshold buffer around such segments, or by identifying dual carriageways or other road types in need of simplification. This could involve
    1. Filter parts of the input route network based on OSM data 'rnet_x' to generate a minimal dataset
    2. Remove the filtered dataset from the original to avoid duplicating them
    3. Subset the rnet_y object (OS Open Roads) to only those within a buffer surround the rnet_x and merge on the attributes. Use the following syntax to get only OS roads that are within the buffer, e.g. with the following syntax:
rnet_x_selected_buffer = st_buffer(st_union(rnet_x_selected), dist = 50)
rnet_y_selected = rnet_y[rnet_x_selected_buffer, , op = st_within]
  1. rbind() the resulting merged network back with the original rnet_x (the version that excludes the lines to simplify)
  2. 🚀 pmtiles
  • Check to see if merge is better in places far from the centre of Scotland (hypothesis: yes)
  • Share the updated GeoJSON for tiling
  • Think about how to keep segments that are not in the open roads dataset but which are in OSM, thoughts?

One idea on the last point: only do simplification on segments that have high cycling potential (e.g. more than 100) under the Go Dutch scenario or which are contained by a buffer around those high cycling segments.

And points from @mem48 in nptscot/networkmerge#8

In terms of re-building the national network, I'm thinking about how to speed-up the process. As a bonus, you could take a look at and try to fix this: ropensci/stplanr#522

All this will help to fix #64 have a simplified network up soon!

@Robinlovelace
Copy link
Contributor Author

Good conversation with Zhao and I this morning, we talked about testing on a small network first and ways to only do the simplification on a subset of 'rnet_y'. Next steps: @wangzhao0217 to iterate on this, report progress here and update code in #292. Stretch aim: merge that PR based on results for a small subset of the network based on the latest version of {stplanr} by end of the day.

@Robinlovelace
Copy link
Contributor Author

Robinlovelace commented Oct 15, 2023

Looks like there's a new release here: https://github.com/nptscot/npt/releases/tag/simplified_network_merge

Can you point us to the code that generated this dataset @wangzhao0217 ? We should get #292 merged.

@mem48 can you take a look at get get this onto our test website if good?

@wangzhao0217 wangzhao0217 linked a pull request Oct 16, 2023 that will close this issue
@wangzhao0217
Copy link
Collaborator

Looks like there's a new release here: https://github.com/nptscot/npt/releases/tag/simplified_network_merge

Can you point us to the code that generated this dataset @wangzhao0217 ? We should get #292 merged.

@mem48 can you take a look at get get this onto our test website if good?

Hi @Robinlovelace @mem48 ,
Please find the latest results here https://github.com/nptscot/npt/releases/download/simplified_network_merge/rnet_simplifed_20_15_20231015_130303.pmtiles
It doesn't resolve all the issues, but it addresses 3 out of 4.

@Robinlovelace
Copy link
Contributor Author

Good stuff Zhao. It's moving in the right direction and better than the tiles currently hosted on our test website!

@Robinlovelace
Copy link
Contributor Author

This is looking great to me:

image

Source: https://nptscot.github.io/#12.06/55.95122/-3.17407

Credit: @mem48 here: nptscot/nptscot.github.io@6cfb364

This is good enough for now. @wangzhao0217 can you open a new issue to document any remaining issues? Whether or not we prioritise fixing these additional issues is TBC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants