Skip to main content
Solved

Transfer flow direction to lines


femo
Contributor
Forum|alt.badge.img+6
  • Contributor

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?

Best answer by mygis

Hi @femo ,

Please try the orientor or the networkFlowOrientor transformers.

View original
Did this help you find an answer to your question?

7 replies

mygis
Supporter
Forum|alt.badge.img+13
  • Supporter
  • Best Answer
  • June 28, 2017

Hi @femo ,

Please try the orientor or the networkFlowOrientor transformers.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 28, 2017

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.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 28, 2017

@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.


takashi
Influencer
  • June 28, 2017
mygis wrote:

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.

 

 


femo
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 10, 2017
takashi wrote:
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?

 


takashi
Influencer
  • July 10, 2017
takashi wrote:
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.

femo
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 11, 2017
takashi wrote:
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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings