Skip to main content
Question

How to aggregate into single point features?

  • October 25, 2016
  • 4 replies
  • 226 views

I'm trying to take points that are identical in geometry and attributes (except for a duration attribute: number of seconds) and make them into a single point with the same attributes, but sum the duration attribute. The points need to be grouped by account number. I have tried using Aggregator, which is almost what I want, but that produces multipoint features, whereas I need single points.

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

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • 1442 replies
  • October 25, 2016

Hi @kevwin,you probably need the geometry of one point with the duration values from all the identical points.

I would still use the aggregator but initially split the data into 2 streams, one without geometry (geometry remover) and aggregated to sum the duration values and a second sampled (sampler) to one point.

Then merge the two streams back into the geometry using the points id.

Hope this helps.


todd_davis
Influencer
Forum|alt.badge.img+23
  • Influencer
  • 313 replies
  • October 25, 2016

You could also use the Matcher, put a "List Name on SingleMatched Output" and put the same "group by" you used in the aggregator, into "Selected attribute" in the Matcher. Then use a ListSummer of the data coming out of the SingleMatched Port to calculate the entire duration.

There might also be some features that aren't Matched, so good idea to have something connected out of that port of the matcher as well.


takashi
Celebrity
  • 7843 replies
  • October 25, 2016

Hi @kevwin, alternatively a pair of the GeometryExtractor and the GeometryReplacer might also be available.

  1. GeometryExtractor: Save the geometry as an attribute e.g. "_geometry".
  2. Aggregator: Calculate the sum of the duration attribute and keep other attributes.
  3. GeometryReplacer: Restore a single point geometry from "_geometry".

Forum|alt.badge.img
  • 30 replies
  • January 30, 2020

Hi @kevwin, alternatively a pair of the GeometryExtractor and the GeometryReplacer might also be available.

  1. GeometryExtractor: Save the geometry as an attribute e.g. "_geometry".
  2. Aggregator: Calculate the sum of the duration attribute and keep other attributes.
  3. GeometryReplacer: Restore a single point geometry from "_geometry".

I know this is old, but I needed to do this and your suggestion worked perfectly. Thank you, Randy McGregor