Skip to main content
Solved

Counting combinations of 2 overlapping circles

  • May 18, 2018
  • 6 replies
  • 32 views

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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • 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+37
  • Contributor
  • 2002 replies
  • 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
  • Author
  • 56 replies
  • May 18, 2018

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
  • Author
  • 56 replies
  • 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
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
Celebrity
  • 7843 replies
  • May 19, 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
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
  • Author
  • 56 replies
  • May 19, 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
Thank you very much

 

It works fine :)