aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-20 22:37:50 +1200
committerGitHub <noreply@github.com>2017-06-20 22:37:50 +1200
commit98ba0e282a64ecddb7bb8f1b2075b5bab0ef3eac (patch)
tree825c03638ad5f3fb73016035c35c97523edc8784 /src/org/traccar/BasePipelineFactory.java
parent6f569b6d62b110c2679772c4a56122db6a614ed9 (diff)
parent9129b6f4eb6ab58a83107e47c888bb4a3bbf0f90 (diff)
downloadtrackermap-server-98ba0e282a64ecddb7bb8f1b2075b5bab0ef3eac.tar.gz
trackermap-server-98ba0e282a64ecddb7bb8f1b2075b5bab0ef3eac.tar.bz2
trackermap-server-98ba0e282a64ecddb7bb8f1b2075b5bab0ef3eac.zip
Merge pull request #3269 from Abyss777/distance_optimization
Distance calculation optimization
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);
}