aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-27 22:58:35 +1300
committerGitHub <noreply@github.com>2016-11-27 22:58:35 +1300
commit58db487ece3ac8644557145a07a75ce4bf63a344 (patch)
tree29f18d871486df89c202e32a82fe143acc3754f7 /src/org/traccar/model
parentf1b58491f6dc2a50312efb19f501d2121ed06b08 (diff)
parentf933147c0cba53df96448a64a2ba58dda4da1659 (diff)
downloadtrackermap-server-58db487ece3ac8644557145a07a75ce4bf63a344.tar.gz
trackermap-server-58db487ece3ac8644557145a07a75ce4bf63a344.tar.bz2
trackermap-server-58db487ece3ac8644557145a07a75ce4bf63a344.zip
Merge pull request #2608 from Abyss777/polyline_geofence
Implemented polyline geofence
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/Geofence.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java
index ecfd3101c..326c45b5f 100644
--- a/src/org/traccar/model/Geofence.java
+++ b/src/org/traccar/model/Geofence.java
@@ -17,9 +17,11 @@ package org.traccar.model;
import java.text.ParseException;
+import org.traccar.Context;
import org.traccar.geofence.GeofenceCircle;
import org.traccar.geofence.GeofenceGeometry;
import org.traccar.geofence.GeofencePolygon;
+import org.traccar.geofence.GeofencePolyline;
import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -27,6 +29,7 @@ public class Geofence extends Extensible {
public static final String TYPE_GEOFENCE_CILCLE = "geofenceCircle";
public static final String TYPE_GEOFENCE_POLYGON = "geofencePolygon";
+ public static final String TYPE_GEOFENCE_POLYLINE = "geofencePolyline";
private String name;
@@ -60,6 +63,8 @@ public class Geofence extends Extensible {
geometry = new GeofenceCircle(area);
} else if (area.startsWith("POLYGON")) {
geometry = new GeofencePolygon(area);
+ } else if (area.startsWith("LINESTRING")) {
+ geometry = new GeofencePolyline(area, Context.getConfig().getDouble("geofence.polylineDistance", 25));
} else {
throw new ParseException("Unknown geometry type", 0);
}