Traccar does not handle non-sequential data well. There's no special handling for it.
Thank you, Anton, for the quick response; I understand what you're saying.
Could you take a quick glimpse and let me know if the way I'm thinking of tackling this problem makes sense, especially in terms of server resources?
Modify DistanceHandler to compare the timestamp of the current position with the position stored in CacheManager. This way, the condition for calculation would be that the last is not greater than the current time. In doing so, the margin of error would at least be limited. Nonexistent distances would not be added. I'd prefer to have zero values for non-sequential cases.
In FilterHandler, I'm thinking of creating a prior condition to enable filterRelative. This would involve comparing the timestamps of the current position and CacheManager. Only when the current position is older than the one in CacheManager would filterRelative be enabled. And filterRelative would then use DistanceCalculator between the current position and the preceding one. This way, the distance and maxSpeed filters would work well, and it wouldn't always be calculating, just when the data is non-sequential.
This is just to ease my mind: EngineHoursHandler, by its very nature, always has correct values because the fixtime is either added or subtracted to the overall hours, correct?
Hello everyone, I hope you can help me with this query. I understand that Traccar has a filterRelative feature to help with devices that send information in a non-sequential manner (i.e., not FIFO).
My question is about the distance calculation and the application of filters.
I am looking at the DistanceHandler.java and FilterHandler.java files, but I don't see any consideration for what would happen in the case of information arriving out of sequence.
Is it possible that filterMaxSpeed uses the "last" from filterRelative (if it is active) to calculate the time difference, but does not use it to calculate the distance? Doesn't this defeat the purpose? Same occur for filterDistance.
How does DistanceHandler handle non-sequential values? I see that the distance is calculated using the current position and the "last" position found in CacheManager.
Thank you in advance. Unfortunately, the issue is on our end, as we have multiple devices that operate in a non-sequential manner.