diff options
author | Abyss777 <abyss@fox5.ru> | 2016-11-27 16:01:24 +0700 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-11-27 16:01:24 +0700 |
commit | f933147c0cba53df96448a64a2ba58dda4da1659 (patch) | |
tree | 4103302744f4ff1cfc5c3ff207aa68b516d7ee8c /src/org/traccar/geofence/GeofencePolyline.java | |
parent | 5ea4572553a84126b7e9f06c822e1a183413a558 (diff) | |
download | trackermap-server-f933147c0cba53df96448a64a2ba58dda4da1659.tar.gz trackermap-server-f933147c0cba53df96448a64a2ba58dda4da1659.tar.bz2 trackermap-server-f933147c0cba53df96448a64a2ba58dda4da1659.zip |
- Remove try-catch frome tests
- Fixed longitude normalizing for geofences near 180 longitude
- Added more tests
- Other fixes
Diffstat (limited to 'src/org/traccar/geofence/GeofencePolyline.java')
-rw-r--r-- | src/org/traccar/geofence/GeofencePolyline.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/org/traccar/geofence/GeofencePolyline.java b/src/org/traccar/geofence/GeofencePolyline.java index cadc69da6..d84f512e3 100644 --- a/src/org/traccar/geofence/GeofencePolyline.java +++ b/src/org/traccar/geofence/GeofencePolyline.java @@ -36,11 +36,10 @@ public class GeofencePolyline extends GeofenceGeometry { @Override public boolean containsPoint(double latitude, double longitude) { - double longitude360 = longitude + Coordinate.DEGREE360; for (int i = 1; i < coordinates.size(); i++) { if (DistanceCalculator.distanceToLine( - latitude, longitude360, coordinates.get(i - 1).getLat(), coordinates.get(i - 1).getLon360(), - coordinates.get(i).getLat(), coordinates.get(i).getLon360()) <= distance) { + latitude, longitude, coordinates.get(i - 1).getLat(), coordinates.get(i - 1).getLon(), + coordinates.get(i).getLat(), coordinates.get(i).getLon()) <= distance) { return true; } } |