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
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.
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
Hi @lifeinabox , a well known approach for giving an identical group ID value to polygons close each other within a specific distance is:
- Bufferer: Create buffers of the original polygons by 0.25 meters (= 0.5 / 2) buffer amount.
- Dissolver: Dissolve the buffer polygons. Here, buffers from polygons belonging to a group will be a single area.
- Counter: Add sequential number as group ID to the dissolved areas.
- 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 @lifeinabox , a well known approach for giving an identical group ID value to polygons close each other within a specific distance is:
- Bufferer: Create buffers of the original polygons by 0.25 meters (= 0.5 / 2) buffer amount.
- Dissolver: Dissolve the buffer polygons. Here, buffers from polygons belonging to a group will be a single area.
- Counter: Add sequential number as group ID to the dissolved areas.
- 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 .
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 .
👍