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

Excessive nodes (+links) remain in final link/node list #10

Closed
Lvulis opened this issue Mar 28, 2020 · 4 comments
Closed

Excessive nodes (+links) remain in final link/node list #10

Lvulis opened this issue Mar 28, 2020 · 4 comments
Labels
documentation documentation to-do good first issue Good for newcomers

Comments

@Lvulis
Copy link
Collaborator

Lvulis commented Mar 28, 2020

I have noticed some extra nodes remain especially around islands. This leads to an extra link around those islands. Not sure what may be causing this (maybe spurs near those islands as well). I will look into it more later and if I find anything will post here as well. These should have been removed during the remove spurs call. Data (shoreline, inlet node, nodes/links jsons, skel) is below the examples:
image
image
image

Data:
Yukon_GSW_201407.zip

@jonschwenk
Copy link
Collaborator

"It's a feature, not a bug!"

These are called artificial nodes. You can query them with delta_class_object.nodes['arts']. Alex suggested they be incorporated long ago, so they've always been in RivGraph. Their inclusion stems from consideration of the topologic metrics--many of the metrics "fail" in cases of parallel links (i.e. two links that start and end at the same node). The solution for this is to place an "artificial node" at the midpoint of the longer of the parallel links. This does not alter the topology at all.

It should not be too hard to craft a function to remove the artificial nodes, and it's been on the back burner for awhile now. I'll add it to the to-do list.

@Lvulis
Copy link
Collaborator Author

Lvulis commented Mar 29, 2020

OK - I will keep this in mind, thanks!

@jonschwenk
Copy link
Collaborator

This issue has been resolved and will be included in the next build of RG. The github repo is up to date as of now.

The better approach here was to not add artificial nodes by default, but provide the functionality for the user to do so immediately before computing metrics that required them. The problem with this is that the artificial nodes were ingrained into the directionality algorithms.

The implemented solution replaces the artificial node directionality algorithms with a new "parallel links" one that effectively does the same thing. It was tested successfully on the Colville but requires further testing on other deltas/braided rivers.

The add_artificial_nodes() function is no longer called by default when pruning your network. It can now be called either before or after running directionality algorithms, and will copy as much information to the new artificial links as possible. However, users will need to recompute link lengths and widths after running this--a print statement informs them of this.

@Lvulis
Copy link
Collaborator Author

Lvulis commented Jun 11, 2020

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation documentation to-do good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants