aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-05-12 22:32:36 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-05-12 22:32:36 +1200
commit85067159044c06bded8e64c8d832591c5e567ff2 (patch)
tree912f559ba1d9871ade5e3bd69c2b64cdd64f2df9 /src/org
parent002f3d47cc4a31268dd2c0b018f70a0042268e0d (diff)
downloadtrackermap-server-85067159044c06bded8e64c8d832591c5e567ff2.tar.gz
trackermap-server-85067159044c06bded8e64c8d832591c5e567ff2.tar.bz2
trackermap-server-85067159044c06bded8e64c8d832591c5e567ff2.zip
Fix STL060 decoder
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Stl060ProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java
index b5a67dbab..211483aed 100644
--- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java
@@ -40,8 +40,8 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder {
"[^,]*," + // Vehicle
"(\\d{2})/(\\d{2})/(\\d{2})," + // Date
"(\\d{2}):(\\d{2}):(\\d{2})," + // Time
- "(\\d{2})(\\d+)([NS])," + // Latitude
- "(\\d{3})(\\d+)([EW])," + // Longitude
+ "(\\d{2})(\\d{2})\\.?(\\d+)([NS])," + // Latitude
+ "(\\d{3})(\\d{2})\\.?(\\d+)([EW])," + // Longitude
"(\\d+\\.?\\d*)," + // Speed
"(\\d+\\.?\\d*)," + // Course
"(\\d+)," + // Milage
@@ -95,13 +95,13 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder {
// Latitude
Double latitude = Double.valueOf(parser.group(index++));
- latitude += Double.valueOf(parser.group(index++)) / 600000;
+ latitude += Double.valueOf(parser.group(index++) + parser.group(index++)) / 600000;
if (parser.group(index++).compareTo("S") == 0) latitude = -latitude;
position.setLatitude(latitude);
// Longitude
Double longitude = Double.valueOf(parser.group(index++));
- longitude += Double.valueOf(parser.group(index++)) / 600000;
+ longitude += Double.valueOf(parser.group(index++) + parser.group(index++)) / 600000;
if (parser.group(index++).compareTo("W") == 0) longitude = -longitude;
position.setLongitude(longitude);