I have sensor data with location longitude and latitude. I have the following data points:
And I would like to aggregate points within a certain distance from each other to one point along the route, like this:
Each new point will be in the centre of the circle and will include the average of all sensor reading for the given area. I have tried removing precision from the longitude and latitude, but the results I get are bad and the route loses its shape.
I actually solved the problem using kmeans clustering. You pass as arguments the coordinates of all points and the number of output points you want and it gives you clusters by which to aggregate the points.