Skip to main content

I have a few hundreds of points and I'm trying to:

1) 'Cluster' them spatially (max distance 25cm) and based on one common attribute while the number of neighbors can vary from 0 to 5

2) Calculate average position for each 'cluster' of points and replace their geometry so that all aggregated points have the same position (of course keeping the original attributes).

I would be grateful for a hint, I've been trying different transformers and I can't find a solution.

1) NeighborhoodAggregator generates the groups

2) CenterpointExtractor calculates the X and Y of the center point of the group

VertexCreator replaces the geometry by a point using the X and Y


Hi @erik_jan,

thanks for your reply! I tried NeighbourhoodAggregator, but from there I had to work with lists if I wanted to keep all attributes (is that correct?). This is where I got stuck, I didn't know how to handle the lists and extract centerpoints. Is it possible?


Hi @erik_jan,

thanks for your reply! I tried NeighbourhoodAggregator, but from there I had to work with lists if I wanted to keep all attributes (is that correct?). This is where I got stuck, I didn't know how to handle the lists and extract centerpoints. Is it possible?

You can use the ListExploder after the CenterpointExtractor to create the individual objects (including the calculated X and Y and the original attributes).

 

 


You can use the ListExploder after the CenterpointExtractor to create the individual objects (including the calculated X and Y and the original attributes).

 

 

This was indeed my missing element! Thank you

Reply