Hi @femo ,
Please try the orientor or the networkFlowOrientor transformers.
Several ways as usual.
One would be to connect the lines first, then count the vertices between start and end.
You could check if the highest count value as at the and valu of the flow, if not reverse line or reverse count.
Also do same to the line pieces, but keep their direction (as you want to establish this).
Sum all the value-pairs(they need to be linked via a point on point or so).
After end of a line piece and start of a new one...
if direction is same then
(vertexcount*2 - max.count of previous linepiece = (vertexcount of new piece + vertex count of the joined pieces)
If not direction is reversed at that point.
@femo
..I forgot overlap of points..
vertexcount*2 - (max.count of previous linepiece - first count of line following it)
A pic to illustrate it
If middle line piece would be reversed (3,2,1) then the test would fail.
Hi @femo ,
Please try the orientor or the networkFlowOrientor transformers.
I agree that the NetworlFlowOrientor can be used here.
For instance, send all lines on the way from 6630 to 6629 to the Line port, send the end point of the way to the Destination port. The transformer adds an attribute called "_direction" to the lines and outputs them via the Network port.
The value of "_direction" is one of "same" and "opposite", which indicates the original direction of the line against the flow direction. That is, if the original direction of a line was the same as the flow direction, the "_direction" attribute will store "same", otherwise "opposite". You can then filter the lines by testing the value of "_direction".
The NewtworkFlowOrientor reverses the direction of "opposite" lines, but you can finally restore the original orientation with the Orientor if necessary.
I agree that the NetworlFlowOrientor can be used here.
For instance, send all lines on the way from 6630 to 6629 to the Line port, send the end point of the way to the Destination port. The transformer adds an attribute called "_direction" to the lines and outputs them via the Network port.
The value of "_direction" is one of "same" and "opposite", which indicates the original direction of the line against the flow direction. That is, if the original direction of a line was the same as the flow direction, the "_direction" attribute will store "same", otherwise "opposite". You can then filter the lines by testing the value of "_direction".
The NewtworkFlowOrientor reverses the direction of "opposite" lines, but you can finally restore the original orientation with the Orientor if necessary.
hi @takashi ,
at least I find time to read and try out what you suggested.
I have the situation of 6 lines (routed to the "Line-port") and one Point (routed to the "Destination-Port" .
Both, lines and Points, have got the Attribute "KNO_SZ_E". All 6 lines belong to the same network (Network topology builder).
However, they are output through the "unused" port, even with a set "_direction" attribute (same)
I am puzzled, because I don not see any reason for these lines NOT to be Output through the "Network" port. Do you have any idea?
Make sure that:
- the destination point exactly match one of the nodes of the network.
- the destination point and all the lines have the same value in the "KNO_SZ_E" attribute.
the "anchored snapper" ensured, that the first criteria was met!
Thanks a lot takashi