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

Add function to "uncompound" junctions #190

Closed
mpadge opened this issue Sep 12, 2022 · 4 comments
Closed

Add function to "uncompound" junctions #190

mpadge opened this issue Sep 12, 2022 · 4 comments
Labels
enhancement New feature or request must do Critically important

Comments

@mpadge
Copy link
Member

mpadge commented Sep 12, 2022

Weighted street networks with turn penalties create and rely on compound junctions. To allow flow aggregation and centrality calculations on these networks, there needs to be an additional function to re-map flows along these compound edges back on to the original "uncompounded" network edges.

@mpadge mpadge added enhancement New feature or request must do Critically important labels Sep 12, 2022
mpadge added a commit that referenced this issue Sep 12, 2022
mpadge added a commit that referenced this issue Sep 12, 2022
mpadge added a commit that referenced this issue Sep 12, 2022
@mpadge
Copy link
Member Author

mpadge commented Sep 12, 2022

This has already been implemented in dodgr_uncontract_graph(), but that function is not called by default within centrality and flow functions. Just need to modify those to ensure that it is called to uncompound and remove those junction edges.

@mpadge
Copy link
Member Author

mpadge commented Sep 12, 2022

The uncompounding code is now in a separate function which is called at the end of centrality. Now also have to call that at the end of the flow functions, plus ensure that a tidy workflow can be explained especially when using single graphs between different sessions. This will mostly reduce to ensuring that compound junctions are removed from the main graph prior to saving, and that it is then possible to re-insert the compound junctions through exporting the current join_junctions_to_graph() function: /~https://github.com/ATFutures/dodgr/blob/4c78bb57e813929e2bc4b43a8ebe129e347d6975/R/weight-streetnet-times.R#L551-L552

@mpadge
Copy link
Member Author

mpadge commented Sep 12, 2022

An even cleaner way is to always return a standard graph from all functions, and to create and insert compound junctions on-the-fly within individual functions which need them. The only problem with that is that, while turn penalties are entirely possible, turn restrictions can only be implemented with the original sc-class data used to create the graph. The solution is to store those as an two extra data.frame attributes of the graph. The next commits will implement that.

@mpadge
Copy link
Member Author

mpadge commented Sep 14, 2022

closed via #191

@mpadge mpadge closed this as completed Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request must do Critically important
Projects
None yet
Development

No branches or pull requests

1 participant