diff options
Diffstat (limited to 'src/org/traccar/model/Geofence.java')
-rw-r--r-- | src/org/traccar/model/Geofence.java | 5 |
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); } |