Hi Peter and everyone,
First off many thanks for creating and working on this code, it is very useful.
I am using the 0.7 version of GH, as a reference.
I am trying to understand how to associate the original direction of an edge with the direction traveled by the routing algorithm.
Here is a simple example, with three edges, A, B and C:
A B C
2<-------1<-------4<-----3
The numbers are the nodes created. The reason for the strange sequence is the order the edges were added:
First add edge A, which creates 1 as the base node and 2 as adjacent
Then add edge C, which creates base node 3 and adjacent 4
Then add edge B. Since the tower nodes already exist, the base node is 4 and adjacent is 1
So now, if I route from 3 to 2 I get the following route:
Edge C, base 3, adj 4
Edge B, base 4, adj 1
Edge C, base 1, adj 2
So now I’m trying to figure out how the edge traversal compares with the original edge direction. I noticed in a couple of posts you suggested using the node comparison, that is, compare if base node < adj node.
But in this case, I would get true, false, true, which does not reflect the original edge direction. Am I wrong in using this? I notice there is a reverse property for each edge, but it’s not exposed to the interface. From looking at the code it looks like it’s used to determine the geometry extraction, which is in line with the true direction of the edge. Is there something that exposes that value? I tried using the isForward function but those don’t return the true direction of the edge.
Let me know if I misunderstood this.
Many thanks.
Daniel