Skip to main content
Question

How do I create a repetitive workflow?


dataninja
Forum|alt.badge.img

Hi, I have an urgent question.

I have a point file. Each point has a rank number and a circle size.

Basically, what I am trying to do is to:

1: Find the point with the highest rank and add it to the selected list.

2: Find the next point with second-highest rank & draw a circle (using circle size), the point is selected and added to the list if there are no selected points (from 1) from the list inside the circle.

3: Find the next point with third-highest rank & draw a circle (using circle size), the point is selected and added to the list if there are no selected points (from 1 & 2) from the list inside the circle.

4: Repeat the process until no points left.

Thank you so much in advance.

12 replies

Forum|alt.badge.img
  • August 22, 2019

The super quick answer would be to use a custom transformer with a Transformer Loop inside it. Then if you create a work flow that does its business inside the CT you can just repeat with the loop until you are out of points.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 22, 2019

I'm wondering if doing this recursively is the best way to go in in FME (it would be in a standard programming language).

What about determining the largest circle size in the dataset. Use a NeighborFinder (candidates only, with the Maximum Distance set to the largest circle size and generating a list containing the rank number and circle size.

 

 

Sort the list by rank number, and then check the elements for a) rank higher than current feature's rank, and b) the distance is less than that element's circle size.

If any of the elements match those two criteria, discard the feature.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 22, 2019

I would not try to do this in a loop.

I would create circles for all points.

Then use a PointonAreaOverlayer to find all points within the circles (generate a list).

If Circles contain no points with lower rank, add the circle to the list.

Hope this helps.


dataninja
Forum|alt.badge.img
  • Author
  • August 22, 2019
erik_jan wrote:

I would not try to do this in a loop.

I would create circles for all points.

Then use a PointonAreaOverlayer to find all points within the circles (generate a list).

If Circles contain no points with lower rank, add the circle to the list.

Hope this helps.

Hi Erik,

I have tried this before but unfortunately it doesn't work because of the following case:


dataninja
Forum|alt.badge.img
  • Author
  • August 22, 2019
dataninja wrote:

Hi Erik,

I have tried this before but unfortunately it doesn't work because of the following case:

Using PointOnAreaOverlayer will drop the point with rank = 8 because of rank = 9. That's why it's very important to do it in order


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 22, 2019
dataninja wrote:

Using PointOnAreaOverlayer will drop the point with rank = 8 because of rank = 9. That's why it's very important to do it in order

No, in the above example with an PointOnAreaOverlayer, the ranks lists should be as follows:

 

 

8: 8

 

9: 8,9,11

 

11: 11

 

 

9 is the only point with a higher rank in the list, and should be discarded,

 

 


dataninja
Forum|alt.badge.img
  • Author
  • August 22, 2019
jdh wrote:

No, in the above example with an PointOnAreaOverlayer, the ranks lists should be as follows:

 

 

8: 8

 

9: 8,9,11

 

11: 11

 

 

9 is the only point with a higher rank in the list, and should be discarded,

 

 

why 8: 8? Doesnt it also contain rank 9?


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 22, 2019
dataninja wrote:

why 8: 8? Doesnt it also contain rank 9?

No, you are comparing the point to the circles it falls in.

 

 

Point 8 is inside circle 8, but not inside circle 9, even though the circle of 8 intersects the circles of 9 and 11.

 

 


dataninja
Forum|alt.badge.img
  • Author
  • August 22, 2019
jdh wrote:

No, you are comparing the point to the circles it falls in.

 

 

Point 8 is inside circle 8, but not inside circle 9, even though the circle of 8 intersects the circles of 9 and 11.

 

 

Actually, if you replace rank = 9 with 12 then this method doesn't work right? it's because 8 & 9 will be selected


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 22, 2019
dataninja wrote:

Actually, if you replace rank = 9 with 12 then this method doesn't work right? it's because 8 & 9 will be selected

If you replace 9 with 12 then you would have

 

 

8: 8

 

11: 11

 

12: 8,11,12

 

 

and 12 would fail, keeping 8 and 11.

dataninja
Forum|alt.badge.img
  • Author
  • August 22, 2019
jdh wrote:

If you replace 9 with 12 then you would have

 

 

8: 8

 

11: 11

 

12: 8,11,12

 

 

and 12 would fail, keeping 8 and 11.

That's not correct though because I want to select the highest rank first (12) go to the second highest (11) and see if its circle contains 12, if so it shouldn't be selected.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • August 22, 2019
dataninja wrote:

That's not correct though because I want to select the highest rank first (12) go to the second highest (11) and see if its circle contains 12, if so it shouldn't be selected.

Oh, I assumed that the highest rank was the lowest number.


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