Is this the totalDistance
attribute? It can only decrease when you update it manually.
Yes, it is.
But this can't be right. I believe none of the users care enough to update this. The value just spikes up for some reason, and we can't figure out why. The math seems correct.
There might be another explanation - the data is uploaded in a wrong order. Then distance calculation can be messed up.
Would filter.relative help in this case?
No, it won't.
Any idea what would? There's nothing we can do against the devices or network issues.
Increasing server.buffering.threshold, so it reorders data?
Yes, you can try increasing buffering threshold. But the correct solution should be on the device side. Good devices offer an option to upload in correct chronological order.
Returning 16 days later, I have encountered this issue again. There's something wrong with the distance calculation. I've checked the data:
id |fixtime |devicetime |speed |distance |totaldistance |latitude |longitude |valid|
---------+-----------------------+-----------------------+------------------+------------------+-----------------+------------------+------------------+-----+
112293300|2025-09-03 05:18:39.000|2025-09-03 05:18:39.000|40.820015097084045|41.005100663172335|6560379.21180506 | 53.096285|103.07026333333333|true |
112293354|2025-09-03 05:18:41.000|2025-09-03 05:18:41.000| 39.06001365494537|5689.248014420947 |6571798.310220371|53.096656666666675|103.07022166666667|true |
There are no positions between these two. There is nothing abnormal in the data.
If I calculate the distance between them using the Haversine Formula you used in the DistanceCalculator, the result is 41.42 meters. How was 5 km written to the DB? Any idea?
Where is the server time? How do you know there were no positions in between?
Found some other data. Seems to be network issues this time. Sorry about that.
Hello,
We are experiencing an issue where Total Distance is somehow spiking up and then decreasing back to some value. Is this a bug or an expected behavior? How do we proceed from here?