aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-14 22:18:40 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-14 22:18:40 -0700
commit9e044f48f06b1201eaf642b2e53e5ba40c46c0ff (patch)
treec20d014dd81b541b7e3e1695450064efdf47a878 /src/main
parente7b6993a0c142fb5a051d169fee2f7111c2884fe (diff)
downloadtraccar-server-9e044f48f06b1201eaf642b2e53e5ba40c46c0ff.tar.gz
traccar-server-9e044f48f06b1201eaf642b2e53e5ba40c46c0ff.tar.bz2
traccar-server-9e044f48f06b1201eaf642b2e53e5ba40c46c0ff.zip
Use position speed limit for events
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/handler/events/OverspeedEventHandler.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
index e534df9de..c396b28e9 100644
--- a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2020 Anton Tananaev (anton@traccar.org)
* Copyright 2018 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -122,6 +122,11 @@ public class OverspeedEventHandler extends BaseEventHandler {
double speedLimit = deviceManager.lookupAttributeDouble(deviceId, ATTRIBUTE_SPEED_LIMIT, 0, true, false);
+ double positionSpeedLimit = position.getDouble(Position.KEY_SPEED_LIMIT);
+ if (positionSpeedLimit > 0) {
+ speedLimit = positionSpeedLimit;
+ }
+
double geofenceSpeedLimit = 0;
long overspeedGeofenceId = 0;