aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-06-20 13:44:35 +0500
committerAbyss777 <abyss@fox5.ru>2017-06-20 13:46:21 +0500
commit9129b6f4eb6ab58a83107e47c888bb4a3bbf0f90 (patch)
tree825c03638ad5f3fb73016035c35c97523edc8784 /src/org/traccar/BasePipelineFactory.java
parent6f569b6d62b110c2679772c4a56122db6a614ed9 (diff)
downloadtrackermap-server-9129b6f4eb6ab58a83107e47c888bb4a3bbf0f90.tar.gz
trackermap-server-9129b6f4eb6ab58a83107e47c888bb4a3bbf0f90.tar.bz2
trackermap-server-9129b6f4eb6ab58a83107e47c888bb4a3bbf0f90.zip
- Combine 'DistanceHandler' and 'CoordinatesHandler'
- Move 'DistanceHandler' closer to beginning of pipeline - Use KEY_DISTANCE instead of distance recalculation
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 45213c1a1..0997e6f11 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -49,7 +49,6 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private int timeout;
private FilterHandler filterHandler;
- private CoordinatesHandler coordinatesHandler;
private DistanceHandler distanceHandler;
private MotionHandler motionHandler;
private GeocoderHandler geocoderHandler;
@@ -126,14 +125,14 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
}
}
+ distanceHandler = new DistanceHandler(Context.getConfig().getBoolean("coordinates.filter"),
+ Context.getConfig().getInteger("coordinates.minError"),
+ Context.getConfig().getInteger("coordinates.maxError"));
+
if (Context.getConfig().getBoolean("filter.enable")) {
filterHandler = new FilterHandler();
}
- if (Context.getConfig().getBoolean("coordinates.filter")) {
- coordinatesHandler = new CoordinatesHandler();
- }
-
if (Context.getGeocoder() != null) {
geocoderHandler = new GeocoderHandler(
Context.getGeocoder(),
@@ -146,8 +145,6 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
Context.getConfig().getBoolean("geolocation.processInvalidPositions"));
}
- distanceHandler = new DistanceHandler();
-
motionHandler = new MotionHandler(Context.getConfig().getDouble("event.motion.speedThreshold", 0.01));
if (Context.getConfig().hasKey("location.latitudeHemisphere")
@@ -196,6 +193,11 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (hemisphereHandler != null) {
pipeline.addLast("hemisphere", hemisphereHandler);
}
+
+ if (distanceHandler != null) {
+ pipeline.addLast("distance", distanceHandler);
+ }
+
if (geocoderHandler != null) {
pipeline.addLast("geocoder", geocoderHandler);
}
@@ -207,14 +209,6 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("filter", filterHandler);
}
- if (coordinatesHandler != null) {
- pipeline.addLast("coordinatesHandler", coordinatesHandler);
- }
-
- if (distanceHandler != null) {
- pipeline.addLast("distance", distanceHandler);
- }
-
if (motionHandler != null) {
pipeline.addLast("motion", motionHandler);
}