Skip to main content
Question

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


aguan
Contributor
Forum|alt.badge.img+11
  • Contributor

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

5 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • 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+10

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+28
  • Contributor
  • June 4, 2018
andreaatsafe wrote:

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
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • June 6, 2018
andreaatsafe wrote:

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
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • June 6, 2018
jdh wrote:

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings