Solved

Counting combinations of 2 overlapping circles


Badge

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 ?

icon

Best answer by jdh 18 May 2018, 19:56

View original

6 replies

Userlevel 4
Badge +30

Hi @lianaolianov,

Did you try to use the transformer AreaOnAreaOverlayer?

This transformer generate a attribute = _overlayer.

Thanks,

Danilo

Badge +22

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
Badge

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.

 

 

Badge

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 ?

 

 

Userlevel 2
Badge +17

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)
Badge

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 :)

 

 

Reply