diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-13 02:47:03 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-13 11:47:36 +1200 |
commit | eee59141bd21d929467819a8eb6c904140efceaa (patch) | |
tree | 7d0e9ac5845fc891dae85be38f19fd22a274f507 /src | |
parent | bdf451b3e4ecf0746dffed44ce0f973e06ac0f22 (diff) | |
download | traccar-server-eee59141bd21d929467819a8eb6c904140efceaa.tar.gz traccar-server-eee59141bd21d929467819a8eb6c904140efceaa.tar.bz2 traccar-server-eee59141bd21d929467819a8eb6c904140efceaa.zip |
Fix max speed filtering (fix #3342)
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 3 | ||||
-rw-r--r-- | src/org/traccar/FilterHandler.java | 2 |
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; } |