Skip to main content
Question

Force custom transformer to process features one at a time


anderstgd
Contributor
Forum|alt.badge.img+6

Is it possible to force a custom transformer to process features one at a time when there are blocking transformers within the custom transformer?

I run into this problem when I try to create a 3DGeneralizer and want to process lines individually.

Example: A custom transformer splitt lines into vertices. The lines are also generalized. NeighborFinder is used to match vertices and generalized lines. I want the NeighborFinder to only process features (line and vertices) from a single line at a time. If Group By is used in NeighborFinder it will block features until all lines have entered the custom transformer.

Thanks, Anders

j.botterill
Influencer
Forum|alt.badge.img+36

Group based transformers process features in batches. So you need an attribute with the numer of groups in it. So perhaps you need a field with Counter output to create a unique id to use in the group by.

Looping with Blocking Transformers: Utilize the looping capabilities within FME to manage the flow of features through blocking transformers. This involves developing a custom transformer that can bypass FME's natural process of transformation by looping features from one point of processing to another

read up about adding loop to your custom transformer - Looping with a Blocking Transformer

Another option might be Workspace runner, where the child workspace has the custom transformer elements in main

Some other articles How use group by on custom transformer? | Community


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • April 2, 2025

Under the assumption that you want to re-combine the original vertices with the generalized lines again, with the distance between the original vertex and the generalized line (Otherwise I do not see the need for the NeighborFinder) you could add a unique ID to every line before processing, make sure that the LineID is also attached to the individual vertices, then use the Generate List option. Afterwards you can filter the list based on the Line ID. This would add a bit of processing, but avoids the need for Group processing.

Not sure if this would be an option, but it might help.


anderstgd
Contributor
Forum|alt.badge.img+6
  • Contributor
  • April 6, 2025
j.botterill wrote:

Group based transformers process features in batches. So you need an attribute with the numer of groups in it. So perhaps you need a field with Counter output to create a unique id to use in the group by.

Looping with Blocking Transformers: Utilize the looping capabilities within FME to manage the flow of features through blocking transformers. This involves developing a custom transformer that can bypass FME's natural process of transformation by looping features from one point of processing to another

read up about adding loop to your custom transformer - Looping with a Blocking Transformer

Another option might be Workspace runner, where the child workspace has the custom transformer elements in main

Some other articles How use group by on custom transformer? | Community

Thank you! Looping might solve this, but I was hoping for a less complicated solution.


anderstgd
Contributor
Forum|alt.badge.img+6
  • Contributor
  • April 6, 2025
s.jager wrote:

Under the assumption that you want to re-combine the original vertices with the generalized lines again, with the distance between the original vertex and the generalized line (Otherwise I do not see the need for the NeighborFinder) you could add a unique ID to every line before processing, make sure that the LineID is also attached to the individual vertices, then use the Generate List option. Afterwards you can filter the list based on the Line ID. This would add a bit of processing, but avoids the need for Group processing.

Not sure if this would be an option, but it might help.

Thank you for suggesting a solution to my example, but it was just an example. Sorry!
My question was only the general question if it’s possible to force a custom transformer to process features one at a time.


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