Skip to main content

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.

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.


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.


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.


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:


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


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,

 

 


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?


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.

 

 


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


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.

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.


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.


Reply