You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, I has been using sfnetworks for a while now, and I have faced the next challenge, a network is usually used with a weight column, but this is in a concept, because a network can actually have several weight columns, distance of paths, time of paths, elevation models, etc, etc.
Usually I need to have a variable that specifies which column will be the weight column, I think would be great be able to have something similar as a active weight column, or an attribute where we can know which one is working in a particular context.
What I don't have very clear, is two points about how to support a feature like this one:
If have a special column called weight, and when changing the active column will change the column reflected on this one
If have or not something like sf::st_geometry, sfnetworks::active_weight or similar to retrieve the active weight column
Actually, if a is used a special column, is like the second option would not be necessary, but implement the second option I don't know if would cause the first option to be useless, because have a specific column that always works as weight is a lot more comfy and useful than retrieve it from a function.
Is possible to even implement both of them.
Thx!
The text was updated successfully, but these errors were encountered:
This is an issue that we have been talking about for a while. A problem is that tidygraph does not behave in the same way. In tidygraph you need to always explicitly specify which column to use as weight. Originally we have copied the igraph behavior, in whcih a column in the edges table named "weight" will be used as edge weight without specifying that explicitly, when we did not realize yet that tidygraph behaves differently. This has resulted in a confusing situation.
Since we primarily want to be a bridge between sf and tidygraph, we will probably change the behavior to align with tidygraph in the next version, meaning you will always have to explicitly state what column you want to use as weight (obviously this is a big breaking change). I do like the idea of setting an active weight column, but when tidygraph behaves differently, it would imho create only confusion. For example, when calling a sfnetwork function like st_network_paths() it would recognize this active weight column, but when calling a tidygraph function like centrality_betweenness() on the same network it would not. This harms the function of the package to provide a data structure on which you can apply simultaneously sf and tidygraph functions, enriched with spatial network specific functions of sfnetworks.
Hi all, I has been using sfnetworks for a while now, and I have faced the next challenge, a network is usually used with a weight column, but this is in a concept, because a network can actually have several weight columns, distance of paths, time of paths, elevation models, etc, etc.
Usually I need to have a variable that specifies which column will be the weight column, I think would be great be able to have something similar as a active weight column, or an attribute where we can know which one is working in a particular context.
What I don't have very clear, is two points about how to support a feature like this one:
Actually, if a is used a special column, is like the second option would not be necessary, but implement the second option I don't know if would cause the first option to be useless, because have a specific column that always works as weight is a lot more comfy and useful than retrieve it from a function.
Is possible to even implement both of them.
Thx!
The text was updated successfully, but these errors were encountered: