Skip to main content
Question

How can I group polygons that are close together?

  • September 3, 2020
  • 5 replies
  • 373 views

I'm trying to group together polygons from a single dataset that are in close proximity to one another (0.5 metres). I've used a NeighborFinder (Candidates Only) which gives me a value for distance and have set it to give me a Close Candidates List so that it returns more than one neighbour. However, it is not clear to me how I can tag the features that meet the criteria for belonging to the same group and I have no attribute that I can group by

5 replies

mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • September 3, 2020

Quick answer: create an ID number using the Counter before the NeighborFinder. Then you can retrieve the ID of the closest feature from the candidates list and join (Aggregate) using that.

Alternatively, to merge the polygons together, try the AreaGapAndOverlapCleaner.


  • Author
  • September 3, 2020

now i'm getting somewhere! thanks so much. i was expecting to have to use a group Id further down the line. I looked at the AreaGapAndOverlapCleaner but I think this is an easier way of preserving attributes of polygons I want to keep together.

In terms of the Aggregator, I've merged and concatenated attributes I want to keep but will look into separating these out again now that I have a group ID


takashi
Influencer
  • September 6, 2020

Hi @lifeinabox​ , a well known approach for giving an identical group ID value to polygons close each other within a specific distance is:

  1. Bufferer: Create buffers of the original polygons by 0.25 meters (= 0.5 / 2) buffer amount.
  2. Dissolver: Dissolve the buffer polygons. Here, buffers from polygons belonging to a group will be a single area.
  3. Counter: Add sequential number as group ID to the dissolved areas.
  4. SpatialFilter: Send the dissolved areas to the Filter port, send the original polygons to the Candidate port, and set "Filter Contains Candidate" to the Spatial Predicates to Test parameter. Here, the group ID will be merged to the original polygons.

Hope this helps


  • Author
  • September 7, 2020
takashi wrote:

Hi @lifeinabox​ , a well known approach for giving an identical group ID value to polygons close each other within a specific distance is:

  1. Bufferer: Create buffers of the original polygons by 0.25 meters (= 0.5 / 2) buffer amount.
  2. Dissolver: Dissolve the buffer polygons. Here, buffers from polygons belonging to a group will be a single area.
  3. Counter: Add sequential number as group ID to the dissolved areas.
  4. SpatialFilter: Send the dissolved areas to the Filter port, send the original polygons to the Candidate port, and set "Filter Contains Candidate" to the Spatial Predicates to Test parameter. Here, the group ID will be merged to the original polygons.

Hope this helps

Hi Takashi, thanks for your reply. Funnily enough I ended up using this approach before seeing your reply as i found some issues with the results produced by NeighbourFinder .


takashi
Influencer
  • September 7, 2020
lifeinabox wrote:

Hi Takashi, thanks for your reply. Funnily enough I ended up using this approach before seeing your reply as i found some issues with the results produced by NeighbourFinder .

👍


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