aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/WebDataHandler.java21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index b9de37ed2..f99d7c97a 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,23 +51,8 @@ public class WebDataHandler extends BaseDataHandler {
double lat = position.getLatitude();
double lon = position.getLongitude();
- 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("%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');
f.format("%.2f,%.2f,", position.getSpeed(), position.getCourse());
f.format("%1$td%1$tm%1$ty,,", calendar);