aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2024-05-31 18:06:52 -0700
committerGitHub <noreply@github.com>2024-05-31 18:06:52 -0700
commit01f5675ec0f6ba70fee076035201afc6ef3acc75 (patch)
treeb02b3fb9548dc03480c2c1f89e46870744d1645d /src/main/java/org/traccar
parentc5833f49feae54b453d667ea02a82fada43a7d46 (diff)
parent6bfcdcc8640cac20900383dd38b55cfe9225a567 (diff)
downloadtrackermap-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.java2
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;
}