Replies: 3 comments
-
This is expected behaviour. In undirected networks igraph/tidygraph will always let the node with the lowest ID be the "from" node. Given that "from" and "to" does not have any meaning in undirected networks, we decided not to reverse the edge linestrings in cases where the endpoint of the line has a lower node ID than the startpoint. Having said that, I am considering changing that behaviour, and actually reverse the linestrings such that the "from" node will always equal the startpoint of the line, since it currently complicates code in some functions |
Beta Was this translation helpful? Give feedback.
-
:O Good to know, personally complicates other codes too, when you work with directed lines you need the line in the right direction for example, to create a particular directed line. |
Beta Was this translation helpful? Give feedback.
-
Still thinking about how to best handle this, as I rather not constantly have to check if after doing an operation the lines are still directed according to the specified from and to indices. And in the end, with undirected network we are not really working with directed lines. There is no clear "from" and "to". However, as a current solution, I did add the utility function I will convert this issue to a discussion, as it is not a bug, but rather a discussion about design choices |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Imagine you have two nodes,
And you have an edge with them, for now it will be not directed.
It is possible for sfnetworks to have a edge of this type:
From 1 to 2 with a linestring (0, 2) to (0, 1) which does not follow the right nodes direction.
Reproducible example
If you compare on roxel network, there is a edge from node 1 to 27 where the first point of the vector is from node 27 instead of node 1.
Expected behavior
If the edge declares from node X to node Y, the path should start with the node X and end with the node Y.
R Session Info
Thx!
Beta Was this translation helpful? Give feedback.
All reactions