Skip to main content
Question

How to create the group centers for each groups of points?

  • June 4, 2018
  • 5 replies
  • 74 views

aguan
Supporter
Forum|alt.badge.img+11
  • Supporter
  • 140 replies

I have a spatial table (an ESRI feature class) that consists of many points. I want to divide the points into groups based on an attribute "projectCode", then create a center of mass for each group. All the centers form a new feature class. Any hint how to do this?.

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

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 4, 2018

Assuming all your points have the same weight, you could use a coordinateExtractor to get the X,Y values of the points, then a StatisticsCalculator (analyze X|Y, group by on projectCode) to get the mean X|Y of each projectCode, then a VertexCreator on the Summary port to create a point at the center of mass.

 

 

EDIT:

 

Ignore the above, the easiest way would be aggregator (group by projectCode), followed by a CenterPointReplacer.

 

 

The documentation for the CenterPointReplacer needs to be updated so that it no longer says Non-area features are rejected.


andreaatsafe
Safer
Forum|alt.badge.img+14
  • Safer
  • 450 replies
  • June 4, 2018

Hi @ag,

 

Have you seen this previous Q&A; post? I think this sounds similar to what you are looking for.

 

You will want to use the Aggregator and Group By "projectCode" instead of the NeighborhoodAggregator to create the groups if you do not need a buffer distance around the points to be in a group.

 

And then use the CenterPointExtractor, then VertexCreator to replace the X/Y attributes with a point.

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • June 4, 2018

Hi @ag,

 

Have you seen this previous Q&A; post? I think this sounds similar to what you are looking for.

 

You will want to use the Aggregator and Group By "projectCode" instead of the NeighborhoodAggregator to create the groups if you do not need a buffer distance around the points to be in a group.

 

And then use the CenterPointExtractor, then VertexCreator to replace the X/Y attributes with a point.
You could just use the centerPointReplacer rather than a CenterPointExtractor and VertexCreator.

 

 

Note that the documentation for the centerPointReplacer and CenterPointExtractor say that non area features will be rejected, which no longer seems true.

 

 


aguan
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • 140 replies
  • June 6, 2018

Hi @ag,

 

Have you seen this previous Q&A; post? I think this sounds similar to what you are looking for.

 

You will want to use the Aggregator and Group By "projectCode" instead of the NeighborhoodAggregator to create the groups if you do not need a buffer distance around the points to be in a group.

 

And then use the CenterPointExtractor, then VertexCreator to replace the X/Y attributes with a point.
@AndreaAtSafe, Yes, the Q&A; post was similar. Thanks.

 


aguan
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • 140 replies
  • June 6, 2018

Assuming all your points have the same weight, you could use a coordinateExtractor to get the X,Y values of the points, then a StatisticsCalculator (analyze X|Y, group by on projectCode) to get the mean X|Y of each projectCode, then a VertexCreator on the Summary port to create a point at the center of mass.

 

 

EDIT:

 

Ignore the above, the easiest way would be aggregator (group by projectCode), followed by a CenterPointReplacer.

 

 

The documentation for the CenterPointReplacer needs to be updated so that it no longer says Non-area features are rejected.

@jdh, yes aggregator followed by CenterPointReplacer works great. Thanks.