Skip to main content
Question

How can I group polygons that are close together?

  • September 3, 2020
  • 5 replies
  • 465 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

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.

5 replies

mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • 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
  • 4 replies
  • 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
Celebrity
  • 7843 replies
  • 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
  • 4 replies
  • September 7, 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

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
Celebrity
  • 7843 replies
  • September 7, 2020

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 .

👍