Skip to main content

Hello,

I have the attributive information that the water flow goes from one point to another point. In the figure below, say from 6630 to 6629. The line geometries that describe the way from 6630 to 6629 know that they belong to that path because they all carrry the respective Information, here "6630_6629".

From the example one can see that the direction of digitazation (blue arrow) of the lines partly correspond to the flow direction. The yellow marked arrows indicate lines where the lines do not correspond to the flow direction. For these lines I want to invert some information ( i do not want to convert the orientation itself!).

Therefore i need to detect from the buch of lines those ones where direction of digitazation and flow direction do not correspond.

I have experimented with the topology builder, at least I manage to isolate the candidates for the mismatch. Those lines where the "from_node" value and the "to_node" values match are those candidates

But how to detect the desired lines?

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?

 


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.

 

 

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.

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

 

 


Reply