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

Preserve certain nodes during smoothing even if they are pseudo nodes #177

Closed
luukvdmeer opened this issue Oct 13, 2021 · 1 comment
Closed
Assignees
Labels
feature 🎁 Request a new feature to_spatial_smooth All issues related to function `to_spatial_smooth()`

Comments

@luukvdmeer
Copy link
Owner

Is your feature request related to a problem? Please describe.
The to_spatial_smooth() morpher now removes all pseudo nodes from the network. The goal of removing pseudo nodes is mainly to speed-up routing tasks. When routing, st_network_paths() finds the nearest nodes to origin and destination points. In the original network, such a nearest node might have been a pseudo node. Since you smoothed your network before routing, however, all these pseudo nodes are gone and the nearest node to a point is now basically the nearest junction node. This will give less accurate shortest paths.

Describe the solution you'd like
It would be nice if you can "protect" some nodes from being smoothed out. E.g. a vector of booleans defining for every node if this node should be protected or not. If TRUE, such a node will not be smoothed out, even if it is a pseudo node. By default we can set this boolean vector to contain only FALSE values, i.e. all nodes that are pseudo nodes will be smoothed out.

In this way, you can first find the nearest nodes to your origin and destination points (or blend these points into the network with st_network_blend()), then smooth the network but protecting these nearest/blended nodes, and then route.

This is similar to the verts argument in dodgr::dodgr_contract_graph(), see here.

@luukvdmeer luukvdmeer added the feature 🎁 Request a new feature label Oct 13, 2021
@luukvdmeer luukvdmeer added the to_spatial_smooth All issues related to function `to_spatial_smooth()` label Nov 26, 2021
@luukvdmeer luukvdmeer self-assigned this Nov 26, 2021
@luukvdmeer
Copy link
Owner Author

Implemented in v0.6.0 through arugment protect, see https://luukvdmeer.github.io/sfnetworks/articles/sfn02_preprocess_clean.html#smooth-pseudo-nodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🎁 Request a new feature to_spatial_smooth All issues related to function `to_spatial_smooth()`
Projects
None yet
Development

No branches or pull requests

1 participant