diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-06-25 19:16:08 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-06-25 19:16:33 +1200 |
commit | 9a597a7f902eea46405a345d4398139c13f69655 (patch) | |
tree | d88a6f51bb56c7a7619924fc0c4744a28a788893 /src | |
parent | 3a24bd121c34d4046a765cd2a55e4847df423c89 (diff) | |
download | traccar-server-9a597a7f902eea46405a345d4398139c13f69655.tar.gz traccar-server-9a597a7f902eea46405a345d4398139c13f69655.tar.bz2 traccar-server-9a597a7f902eea46405a345d4398139c13f69655.zip |
Consider attributes in duplicate filter (fix #3285)
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/FilterHandler.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index 973dfc205..9e532347d 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -93,7 +93,15 @@ public class FilterHandler extends BaseDataHandler { } private boolean filterDuplicate(Position position, Position last) { - return filterDuplicate && last != null && position.getFixTime().equals(last.getFixTime()); + if (filterDuplicate && last != null && position.getFixTime().equals(last.getFixTime())) { + for (String key : position.getAttributes().keySet()) { + if (!last.getAttributes().containsKey(key)) { + return false; + } + } + return true; + } + return false; } private boolean filterFuture(Position position) { |