Question

Averaging points over a given radius

  • 17 February 2022
  • 2 replies
  • 0 views

Badge +2

I have gps points that indicate the speed of a car, I want to sum them around 50 meters averages them. which transformer offers and how it would be worth using

Thanks in advance


2 replies

Badge +20

Use LineBuilder to convert all the points to a path or line. Use Chopper on Line output port in Mode: By Length and Approximate Length 50 (or whatever value you want).

Use Bufferer with a small distance (it doesn't always make sense but it overcomes the need for debugging) : 0.1m...

Use SpatialRelator: buffers as Requestor and original points as Supplier, set as Requestor Contains Supplier and Check Generate List with the speed attribute selected (at least).

ListElementCounter and ListSummer on the list from SpatialRelator, in series.

ExpressionEvaluator/AttributeManager/AttributeCreator with an Arithmetic calculation of _sum/_element_count to get the average speed on the 50m part of the path.

By the way, you should sort your points before so they are in order. Either by time or any attribute that creates a moving path.

I have attached a sample workspace that gets you started.

Userlevel 4
Badge +25

Hi. I thought your questions about traffic analysis were interesting enough to highlight as one of two Questions-of-the-Week. You can find a video explaining my thoughts on the project here: https://www.youtube.com/watch?v=xGvG5z447ps&t=2948s

 

I hope you find it useful.

Reply