Question

FME loop returned 0 for further iteration

  • 28 February 2018
  • 3 replies
  • 2 views

I have a copper cable table which has attributes of startjoint and endjoint. I would like to build a cable path from the lead-in cable to the copper pillar. The logic to build the path is based on the startjoint and endjoint. The cable whose endjoint = startjoint of another cable is the upstream cable. By joining them, a complete path can be built.

Due to the uncertainty of the numbers of cables between the lead-in to the pillar, I would like to use Loop to achieve this. I have used inlinequerier to join the cables and any result returned will go back to the loop. The loop will stop when there is no feature returned where endjoint = startjoint. However, the iteration only occurs 1 and no feature is returned for iteration even there are 11 features output from the result.

Any suggestion what is the best approach to achieve this? Thanks.


3 replies

Badge +22

This is a basic connected component graph problem (https://en.wikipedia.org/wiki/Connected_component_(graph_theory))

 

 

While I would solve this in python, David MacIver wrote a blog post about doing so in SQL.

 

https://www.drmaciver.com/2008/11/computing-connected-graph-components-via-sql/

 

thanks @jdh, your answer is very helpful. But one more question, what is the reason which stops the iteration in the loop. There are 11 features but none of them was sent back to iteration.

Thanks.

Badge +22

At a guess, the inlineQuerier has two input ports, but only one of them has a loop input, so there are no results to the query the second time around since there are no cables for the inner join.

Reply