Skip to main content
Solved

Performing loop queries using FME


gennine
Contributor
Forum|alt.badge.img+4

Hello,
I would like to perform queries on a branched electrical network composed of sections interconnected according to the current direction. However, the "TopologyBuilder" and "NetworkTopologyCalculator" transformers facilitate this task, but have limitations regarding the manipulation of downstream sections.

 

 

For example, I have the entity "i" and I want to collect and query the values ​​of the entity "i+1" (by analogy with the "for" loop in Python), then "i+2", etc.
Do I have to use Python development, or are there other, simpler solutions?
Thank you in advance for your valuable assistance.

Best answer by arenscott

I wonder if the ‘adjacent feature’ functionality in FME would be able to help here:

https://fme.safe.com/blog/2017/08/adjacentfeatureattributes-evangelist166/

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

6 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • May 30, 2025

Do you need to loop? i.e. is the result of the first query required for the second query or do you just want to make multiple queries?


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • May 30, 2025

Thank you @ebygomm. I would like clarification on the process of collecting values ​​from the second connected segment (sometimes there is more than one connected segment) and performing multiple queries. Once completed, I select the next segment, and so on.


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 2, 2025

Whilst it’s possible to do some looping in FME, I’d nearly always choose to do looping within a python caller if it is required.

Do I have to use Python development, or are there other, simpler solutions?

In my experience, looping in FME is often more complicated than a python solution 


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • June 2, 2025

Just one last point, I would like to know what type of python PythonCaller uses (pyQgis, ArcPy, or FME's own library)?

Thank you in advance for your help.


arenscott
Contributor
Forum|alt.badge.img+8
  • Contributor
  • Best Answer
  • June 2, 2025

I wonder if the ‘adjacent feature’ functionality in FME would be able to help here:

https://fme.safe.com/blog/2017/08/adjacentfeatureattributes-evangelist166/


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • June 3, 2025

Many thanks @arenscott. I think this is an excellent way to solve this issue.
I also thank @ebygomm for his suggestion, but unfortunately I'm not very proficient with PythonCaller.


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