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?.
Page 1 / 1
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.
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.
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.
Note that the documentation for the centerPointReplacer and CenterPointExtractor say that non area features will be rejected, which no longer seems true.
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.
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.