aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-04 00:28:33 +1200
committerGitHub <noreply@github.com>2016-07-04 00:28:33 +1200
commitbd21690b702b6aeae07b53ac255b8157d07e8f40 (patch)
treeeea4238487e1418e9590070e8bf253f741be6c30 /src/org
parentebb43a1d910595462b384e3d1bd6375672da5b84 (diff)
parent22f37ea8bac7f45430e56c07d46d06755297f497 (diff)
downloadtrackermap-server-bd21690b702b6aeae07b53ac255b8157d07e8f40.tar.gz
trackermap-server-bd21690b702b6aeae07b53ac255b8157d07e8f40.tar.bz2
trackermap-server-bd21690b702b6aeae07b53ac255b8157d07e8f40.zip
Merge pull request #2072 from Abyss777/master
Double brackets for POLYGON area
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/geofence/GeofencePolygon.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java
index 4ce61a623..33d91c0ff 100644
--- a/src/org/traccar/geofence/GeofencePolygon.java
+++ b/src/org/traccar/geofence/GeofencePolygon.java
@@ -119,14 +119,14 @@ public class GeofencePolygon extends GeofenceGeometry {
@Override
public String toWkt() {
StringBuilder buf = new StringBuilder();
- buf.append("POLYGON (");
+ buf.append("POLYGON ((");
for (Coordinate coordinate : coordinates) {
buf.append(String.valueOf(coordinate.getLat()));
buf.append(" ");
buf.append(String.valueOf(coordinate.getLon()));
buf.append(", ");
}
- return buf.substring(0, buf.length() - 2) + ")";
+ return buf.substring(0, buf.length() - 2) + "))";
}
@Override
@@ -140,7 +140,7 @@ public class GeofencePolygon extends GeofenceGeometry {
if (!wkt.startsWith("POLYGON")) {
throw new ParseException("Mismatch geometry type", 0);
}
- String content = wkt.substring(wkt.indexOf("(") + 1, wkt.indexOf(")"));
+ String content = wkt.substring(wkt.indexOf("((") + 2, wkt.indexOf("))"));
if (content.isEmpty()) {
throw new ParseException("No content", 0);
}