diff options
author | Philipp Prangenberg <philipp.prangenberg@derkurier.de> | 2016-12-05 12:03:08 +0100 |
---|---|---|
committer | Philipp Prangenberg <philipp.prangenberg@derkurier.de> | 2016-12-05 12:03:08 +0100 |
commit | a21f436a58133f7da0cae06366d729665f3b8f9c (patch) | |
tree | 72ff1743d96f79e4a9d85b0d48715e5f9aa67cf9 /src/org/traccar/model/Geofence.java | |
parent | 960bf899414d89221e92138fdb98777c3f4f73ec (diff) | |
parent | 40607036c5aa6385a7ae3f3a283bf107238a5944 (diff) | |
download | trackermap-server-a21f436a58133f7da0cae06366d729665f3b8f9c.tar.gz trackermap-server-a21f436a58133f7da0cae06366d729665f3b8f9c.tar.bz2 trackermap-server-a21f436a58133f7da0cae06366d729665f3b8f9c.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/org/traccar/model/Geofence.java')
-rw-r--r-- | src/org/traccar/model/Geofence.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java index 9a60f784f..326c45b5f 100644 --- a/src/org/traccar/model/Geofence.java +++ b/src/org/traccar/model/Geofence.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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); } |