aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/helper
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-16 18:48:08 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-16 18:48:08 -0700
commit15c4b6b21a31c63bc0f7e624e26d032d531c459d (patch)
tree524ca1dd9aca6ef0ea8db2910a16a3e227e8c1fb /src/main/java/org/traccar/helper
parentee9abd94265eb704b5f5dd2262f1a3460bbe2a8f (diff)
downloadtrackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.tar.gz
trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.tar.bz2
trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.zip
Refactor geofence classes
Diffstat (limited to 'src/main/java/org/traccar/helper')
-rw-r--r--src/main/java/org/traccar/helper/model/GeofenceUtil.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/helper/model/GeofenceUtil.java b/src/main/java/org/traccar/helper/model/GeofenceUtil.java
index f56bf4224..9f063a8b4 100644
--- a/src/main/java/org/traccar/helper/model/GeofenceUtil.java
+++ b/src/main/java/org/traccar/helper/model/GeofenceUtil.java
@@ -15,6 +15,7 @@
*/
package org.traccar.helper.model;
+import org.traccar.config.Config;
import org.traccar.model.Geofence;
import org.traccar.model.Position;
import org.traccar.session.cache.CacheManager;
@@ -27,10 +28,11 @@ public final class GeofenceUtil {
private GeofenceUtil() {
}
- public static List<Long> getCurrentGeofences(CacheManager cacheManager, Position position) {
+ public static List<Long> getCurrentGeofences(Config config, CacheManager cacheManager, Position position) {
List<Long> result = new ArrayList<>();
for (Geofence geofence : cacheManager.getDeviceObjects(position.getDeviceId(), Geofence.class)) {
- if (geofence.getGeometry().containsPoint(position.getLatitude(), position.getLongitude())) {
+ if (geofence.getGeometry().containsPoint(
+ config, geofence, position.getLatitude(), position.getLongitude())) {
result.add(geofence.getId());
}
}