aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoshial <soshial@gmail.com>2021-12-27 15:38:46 +0400
committersoshial <soshial@gmail.com>2021-12-27 15:38:46 +0400
commit29c63d9bf48623ef11e89399e4c7c0e09bf1c446 (patch)
treef10a33381b5937d41759919557e6f212750be68a
parent83cff6dd3876fa81d3f3257f1fb3f72cbdf38e70 (diff)
downloadtraccar-server-29c63d9bf48623ef11e89399e4c7c0e09bf1c446.tar.gz
traccar-server-29c63d9bf48623ef11e89399e4c7c0e09bf1c446.tar.bz2
traccar-server-29c63d9bf48623ef11e89399e4c7c0e09bf1c446.zip
revert to the original filtering logic
-rw-r--r--src/main/java/org/traccar/handler/FilterHandler.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/main/java/org/traccar/handler/FilterHandler.java b/src/main/java/org/traccar/handler/FilterHandler.java
index 6331ff773..e8cafabc8 100644
--- a/src/main/java/org/traccar/handler/FilterHandler.java
+++ b/src/main/java/org/traccar/handler/FilterHandler.java
@@ -147,12 +147,9 @@ public class FilterHandler extends BaseDataHandler {
private boolean filter(Position position) {
- if (skipAttributes(position)) {
- return false;
- }
-
StringBuilder filterType = new StringBuilder();
+ // filter out invalid data
if (filterInvalid(position)) {
filterType.append("Invalid ");
}
@@ -168,10 +165,8 @@ public class FilterHandler extends BaseDataHandler {
if (filterApproximate(position)) {
filterType.append("Approximate ");
}
- if (filterStatic(position)) {
- filterType.append("Static ");
- }
+ // filter out excessive data
long deviceId = position.getDeviceId();
if (filterDuplicate || filterDistance > 0 || filterMaxSpeed > 0 || filterMinPeriod > 0) {
Position preceding = null;
@@ -186,13 +181,13 @@ public class FilterHandler extends BaseDataHandler {
} else {
preceding = getLastReceivedPosition(deviceId);
}
- if (skipLimit(position, preceding)) {
- return false;
- }
if (filterDuplicate(position, preceding)) {
filterType.append("Duplicate ");
}
- if (filterDistance(position, preceding)) {
+ if (filterStatic(position) && !skipLimit(position, preceding) && !skipAttributes(position)) {
+ filterType.append("Static ");
+ }
+ if (filterDistance(position, preceding) && !skipLimit(position, preceding) && !skipAttributes(position)) {
filterType.append("Distance ");
}
if (filterMaxSpeed(position, preceding)) {