Skip to main content
Solved

Counting combinations of 2 overlapping circles


Forum|alt.badge.img

Hello community,

 

I have a set of circles as shown in the picture below, and I wanna count the number of overlapping circles two by two. which means whenever there is overlapping couple of 2 circles there is an overlap to count.

 

For the example below, the result must be 6.

 

is there a way to do it ?

Best answer by jdh

I'm assuming you don't want the number of overlaps for a given segment, but rather the unique combination of overlapping pairs.

 

 

I didn't quite have time to finish this before the long weekend, but all that really needs to be done, is in the PythonCaller change the print statements in the close method to creating a new feature and adding the attributes.

 

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

6 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • May 18, 2018

Hi @lianaolianov,

Did you try to use the transformer AreaOnAreaOverlayer?

This transformer generate a attribute = _overlayer.

Thanks,

Danilo


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • May 18, 2018

I'm assuming you don't want the number of overlaps for a given segment, but rather the unique combination of overlapping pairs.

 

 

I didn't quite have time to finish this before the long weekend, but all that really needs to be done, is in the PythonCaller change the print statements in the close method to creating a new feature and adding the attributes.

 

countoverlappairs.fmw

Forum|alt.badge.img
danilo_fme wrote:

Hi @lianaolianov,

Did you try to use the transformer AreaOnAreaOverlayer?

This transformer generate a attribute = _overlayer.

Thanks,

Danilo

Hello,

 

I tried this transformer but I wasn't getting the results I want, more combinations were counted.

 

 


Forum|alt.badge.img
jdh wrote:

I'm assuming you don't want the number of overlaps for a given segment, but rather the unique combination of overlapping pairs.

 

 

I didn't quite have time to finish this before the long weekend, but all that really needs to be done, is in the PythonCaller change the print statements in the close method to creating a new feature and adding the attributes.

 

countoverlappairs.fmw
Hello,

 

Thank you for your answer, I've seen the workspace but i didn't know how to use it properly, i've never used Python in FME nor elsewhere. How can I get the wanted result from it ?

 

 


takashi
Influencer
  • May 19, 2018
jdh wrote:

I'm assuming you don't want the number of overlaps for a given segment, but rather the unique combination of overlapping pairs.

 

 

I didn't quite have time to finish this before the long weekend, but all that really needs to be done, is in the PythonCaller change the print statements in the close method to creating a new feature and adding the attributes.

 

countoverlappairs.fmw
Hi @lianaolianov, This is an alternative without Python scripting. FYI.

 

count-overlap-pairs-without-python.fmwt (FME 2018.0.0.3)

Forum|alt.badge.img
jdh wrote:

I'm assuming you don't want the number of overlaps for a given segment, but rather the unique combination of overlapping pairs.

 

 

I didn't quite have time to finish this before the long weekend, but all that really needs to be done, is in the PythonCaller change the print statements in the close method to creating a new feature and adding the attributes.

 

countoverlappairs.fmw
Thank you very much

 

It works fine :)

 

 


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