Skip to main content
Solved

Group points spatially and calculate their average positions

  • January 8, 2018
  • 4 replies
  • 106 views

Forum|alt.badge.img

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.

Best answer by erik_jan

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

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.

4 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • Best Answer
  • January 8, 2018

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


Forum|alt.badge.img
  • Author
  • 4 replies
  • January 8, 2018

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?


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • January 8, 2018

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

 

 


Forum|alt.badge.img
  • Author
  • 4 replies
  • January 8, 2018
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