diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-04 17:45:11 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-04 17:45:11 +1300 |
commit | ef19de9ed7b815aef4f3f9640cb9bcc806cf1e41 (patch) | |
tree | 02d594a9ad38209dd62517f1bebbeb66290e325e /src/org/traccar/WebDataHandler.java | |
parent | 722f69031f53bdab5a72e926f101ef4b0df1c828 (diff) | |
download | trackermap-server-ef19de9ed7b815aef4f3f9640cb9bcc806cf1e41.tar.gz trackermap-server-ef19de9ed7b815aef4f3f9640cb9bcc806cf1e41.tar.bz2 trackermap-server-ef19de9ed7b815aef4f3f9640cb9bcc806cf1e41.zip |
Fix misc check style issues
Diffstat (limited to 'src/org/traccar/WebDataHandler.java')
-rw-r--r-- | src/org/traccar/WebDataHandler.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java index 7e8fc1ec4..332fc5222 100644 --- a/src/org/traccar/WebDataHandler.java +++ b/src/org/traccar/WebDataHandler.java @@ -50,8 +50,24 @@ public class WebDataHandler extends BaseDataHandler { double lat = position.getLatitude(); double lon = position.getLongitude(); - f.format("%02d%07.4f,%c,", (int) Math.abs(lat), Math.abs(lat) % 1 * 60, lat < 0 ? 'S' : 'N'); - f.format("%03d%07.4f,%c,", (int) Math.abs(lon), Math.abs(lon) % 1 * 60, lon < 0 ? 'W' : 'E'); + + char hemisphere; + + if (lat < 0) { + hemisphere = 'S'; + } else { + hemisphere = 'N'; + } + + f.format("%02d%07.4f,%c,", (int) Math.abs(lat), Math.abs(lat) % 1 * 60, hemisphere); + + if (lon < 0) { + hemisphere = 'W'; + } else { + hemisphere = 'E'; + } + + f.format("%03d%07.4f,%c,", (int) Math.abs(lon), Math.abs(lon) % 1 * 60, hemisphere); f.format("%.2f,%.2f,", position.getSpeed(), position.getCourse()); f.format("%1$td%1$tm%1$ty,,", calendar); |