diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2024-05-31 18:06:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-31 18:06:52 -0700 |
commit | 01f5675ec0f6ba70fee076035201afc6ef3acc75 (patch) | |
tree | b02b3fb9548dc03480c2c1f89e46870744d1645d /src/main/java/org/traccar | |
parent | c5833f49feae54b453d667ea02a82fada43a7d46 (diff) | |
parent | 6bfcdcc8640cac20900383dd38b55cfe9225a567 (diff) | |
download | trackermap-server-01f5675ec0f6ba70fee076035201afc6ef3acc75.tar.gz trackermap-server-01f5675ec0f6ba70fee076035201afc6ef3acc75.tar.bz2 trackermap-server-01f5675ec0f6ba70fee076035201afc6ef3acc75.zip |
Merge pull request #5326 from jcardus/patch-1
Speed calculation is not correct when the device sends 2 positions in the same second.
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/handler/FilterHandler.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/handler/FilterHandler.java b/src/main/java/org/traccar/handler/FilterHandler.java index 3bb7ef426..700fdbc13 100644 --- a/src/main/java/org/traccar/handler/FilterHandler.java +++ b/src/main/java/org/traccar/handler/FilterHandler.java @@ -153,7 +153,7 @@ public class FilterHandler extends BasePositionHandler { if (filterMaxSpeed != 0 && last != null) { double distance = position.getDouble(Position.KEY_DISTANCE); double time = position.getFixTime().getTime() - last.getFixTime().getTime(); - return UnitsConverter.knotsFromMps(distance / (time / 1000)) > filterMaxSpeed; + return time > 0 && UnitsConverter.knotsFromMps(distance / (time / 1000)) > filterMaxSpeed; } return false; } |