diff options
author | Anton Tananaev <anton@traccar.org> | 2024-07-07 06:51:42 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-07-07 06:51:42 -0700 |
commit | 864872b2df3e26c94d3a5826f4df504de3cf6c62 (patch) | |
tree | 094bbf1cdfd4aa563864537b30306d0666e49490 /src/main/java/org | |
parent | 2005fd55347816cf4a86b66ae97bc245f53f0bcd (diff) | |
download | trackermap-server-864872b2df3e26c94d3a5826f4df504de3cf6c62.tar.gz trackermap-server-864872b2df3e26c94d3a5826f4df504de3cf6c62.tar.bz2 trackermap-server-864872b2df3e26c94d3a5826f4df504de3cf6c62.zip |
Invalid ST-901L-4G coordinates
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/H02ProtocolDecoder.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java index 38c063b52..ed6460e97 100644 --- a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java @@ -350,24 +350,32 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { position.setValid(true); } + double latitude = 0; if (parser.hasNext(3)) { - position.setLatitude(parser.nextCoordinate()); + latitude = parser.nextCoordinate(); } if (parser.hasNext(3)) { - position.setLatitude(parser.nextCoordinate()); + latitude = parser.nextCoordinate(); } if (parser.hasNext(4)) { - position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN_HEM)); + latitude = parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN_HEM); + } + if (latitude != 99 + 99.9999 / 60) { + position.setLatitude(latitude); } + double longitude = 0; if (parser.hasNext(3)) { - position.setLongitude(parser.nextCoordinate()); + longitude = parser.nextCoordinate(); } if (parser.hasNext(3)) { - position.setLongitude(parser.nextCoordinate()); + longitude = parser.nextCoordinate(); } if (parser.hasNext(4)) { - position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN_HEM)); + longitude = parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN_HEM); + } + if (longitude != 999 + 99.9999 / 60) { + position.setLongitude(longitude); } position.setSpeed(parser.nextDouble(0)); |