Question

How to aggregate into single point features?

  • 25 October 2016
  • 4 replies
  • 26 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.


4 replies

Badge +16

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.

Userlevel 1
Badge +12

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.

Userlevel 2
Badge +17

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".
Badge

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

Reply