aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/processing/FilterHandler.java10
-rw-r--r--test/org/traccar/processing/FilterHandlerTest.java2
2 files changed, 4 insertions, 8 deletions
diff --git a/src/org/traccar/processing/FilterHandler.java b/src/org/traccar/processing/FilterHandler.java
index df62b1e6d..eced5d253 100644
--- a/src/org/traccar/processing/FilterHandler.java
+++ b/src/org/traccar/processing/FilterHandler.java
@@ -149,17 +149,13 @@ public class FilterHandler extends BaseDataHandler {
last = Context.getIdentityManager().getLastPosition(position.getDeviceId());
}
- if (skipLimit(position, last) || skipAttributes(position)) {
- return false;
- }
-
if (filterInvalid(position)) {
filterType.append("Invalid ");
}
if (filterZero(position)) {
filterType.append("Zero ");
}
- if (filterDuplicate(position, last)) {
+ if (filterDuplicate(position, last) && !skipLimit(position, last) && !skipAttributes(position)) {
filterType.append("Duplicate ");
}
if (filterFuture(position)) {
@@ -171,10 +167,10 @@ public class FilterHandler extends BaseDataHandler {
if (filterApproximate(position)) {
filterType.append("Approximate ");
}
- if (filterStatic(position)) {
+ if (filterStatic(position) && !skipLimit(position, last) && !skipAttributes(position)) {
filterType.append("Static ");
}
- if (filterDistance(position, last)) {
+ if (filterDistance(position, last) && !skipLimit(position, last) && !skipAttributes(position)) {
filterType.append("Distance ");
}
if (filterMaxSpeed(position, last)) {
diff --git a/test/org/traccar/processing/FilterHandlerTest.java b/test/org/traccar/processing/FilterHandlerTest.java
index e0e9a9912..a497f1043 100644
--- a/test/org/traccar/processing/FilterHandlerTest.java
+++ b/test/org/traccar/processing/FilterHandlerTest.java
@@ -78,7 +78,7 @@ public class FilterHandlerTest extends BaseTest {
@Test
public void testSkipAttributes() {
- Position position = createPosition(0, new Date(), false, 10, 10, 10, 10, 10);
+ Position position = createPosition(0, new Date(), true, 10, 10, 10, 0, 10);
position.set(Position.KEY_ALARM, Position.ALARM_GENERAL);
assertNotNull(filteringHandler.handlePosition(position));