Solved

blocking transformers and looping

  • 14 March 2016
  • 4 replies
  • 4 views

Badge

Hello,

i am trying to dig the basics behind Looping with blocking transformers since I would like to use it in the future.

My simple scenario:

I've got a point that I buffer with various distances. The first distance is 10 m, and then, step by step, I increase the distance by 5 m (thus 10 , 15, 20, etc.). If the value reaches 100 m the process stops.

If I enter the value 17 as the maximum number of iterations 1 features leaves the INCOMPLETE port, with the attribute BUFFERBREITE having the correct value 95 m. As of 18 or further beyond, the ports is empty. This seems to be correct since as of 18 the condition of 100 m is met.

Some things I don't understand:

1. Unlike with Looping throught non-blocking transformers the Output port "Passed" does not appear in the custom transformer (see pic. above "Tester"). There is only the INCOMPLETE Output.

2. The Feature passing through the INCOMPLETE port carries the correct Attribute value BUFFERBREITE=95m. However, if I measure the radius it is about 950 m.

3. My expectation was, that circles with 10 m, 15m, 20m ,etc. would be created. But this is not the case. What should I have to do to meet this expectation?

Many thanks for your support!

icon

Best answer by femo 17 March 2016, 14:59

View original

4 replies

Userlevel 4
Badge +25

Tinkered with it for a bit and came up with this for the custom transformer.

You were looping the buffer feature and I guess that was causing havoc somehow. So I've used a GeometryExtractor/GeometryReplacer combination to bring the original line back before looping back to the input, also created a seperate (unpublished) input for the looping features and doing the buffer incrementing there. It also appears the ExpressionEvaluator is a blocking transformer (I can't really explain why), but the AttributeCreator isn't. Hope this helps, it does generate the output you want :)

looping.fmw

Badge +22

1. Unlike with Looping throught non-blocking transformers the Output port "Passed" does not appear in the custom transformer (see pic. above "Tester"). There is only the INCOMPLETE Output.

Were the Output and Output_2 ports created when you initially created the custom transformer? If not, try removing the custom transformer and re-adding it.

2. The Feature passing through the INCOMPLETE port carries the correct Attribute value BUFFERBREITE=95m. However, if I measure the radius it is about 950 m.

You are looping the buffered feature each time, not the original point, so first time through the loop the buffer is 10m and the radius is 10, the second time through the loop the buffer is is 15 and the radius is 25, so by the time you get to a buffer of 95 the radius is 945

3. My expectation was, that circles with 10 m, 15m, 20m ,etc. would be created. But this is not the case. What should I have to do to meet this expectation?

See redgeographics answer for one possibility.

 

 

Another option would be to loop after the calculation, but before the buffer
Badge

Hi,

you people are great, thanks for sharing ideas and giving support!

@"jdh": the geometry extractor/geometry replacer approach made the difference! The expressionevaluator is not blocking.

@"redgeographics": you were absolutely right with buffering the original point instead of buffering the the buffer. Now I dig it!

Here is my solution:

Badge +3

@femo

My version...with ring output as extra..

Reply