aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-07-13 02:47:03 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-07-13 11:47:36 +1200
commiteee59141bd21d929467819a8eb6c904140efceaa (patch)
tree7d0e9ac5845fc891dae85be38f19fd22a274f507 /src/org/traccar
parentbdf451b3e4ecf0746dffed44ce0f973e06ac0f22 (diff)
downloadtraccar-server-eee59141bd21d929467819a8eb6c904140efceaa.tar.gz
traccar-server-eee59141bd21d929467819a8eb6c904140efceaa.tar.bz2
traccar-server-eee59141bd21d929467819a8eb6c904140efceaa.zip
Fix max speed filtering (fix #3342)
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/BasePipelineFactory.java3
-rw-r--r--src/org/traccar/FilterHandler.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index a6446dbaa..bde4b558b 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -125,7 +125,8 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
}
}
- distanceHandler = new DistanceHandler(Context.getConfig().getBoolean("coordinates.filter"),
+ distanceHandler = new DistanceHandler(
+ Context.getConfig().getBoolean("coordinates.filter"),
Context.getConfig().getInteger("coordinates.minError"),
Context.getConfig().getInteger("coordinates.maxError"));
diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java
index 9e532347d..71c0a1cf5 100644
--- a/src/org/traccar/FilterHandler.java
+++ b/src/org/traccar/FilterHandler.java
@@ -127,7 +127,7 @@ public class FilterHandler extends BaseDataHandler {
if (filterMaxSpeed != 0 && last != null) {
double distance = position.getDouble(Position.KEY_DISTANCE);
long time = position.getFixTime().getTime() - last.getFixTime().getTime();
- return UnitsConverter.knotsFromMps(distance / time) > filterMaxSpeed;
+ return UnitsConverter.knotsFromMps(distance / (time / 1000)) > filterMaxSpeed;
}
return false;
}