diff options
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; } |