aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports/ReportUtils.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-11-10 09:56:30 +0500
committerAbyss777 <abyss@fox5.ru>2017-11-10 09:56:30 +0500
commit96d89e2e352f5cba70a346b1f71bfb3bd399556b (patch)
treebfec39fe84b547dac991f0d38cd69e9c64c688a6 /src/org/traccar/reports/ReportUtils.java
parent404044342a9fc9891366fa4378b4b1330cbca6c3 (diff)
downloadtrackermap-server-96d89e2e352f5cba70a346b1f71bfb3bd399556b.tar.gz
trackermap-server-96d89e2e352f5cba70a346b1f71bfb3bd399556b.tar.bz2
trackermap-server-96d89e2e352f5cba70a346b1f71bfb3bd399556b.zip
- Combine "getAddress" functions
- Change switches logic
Diffstat (limited to 'src/org/traccar/reports/ReportUtils.java')
-rw-r--r--src/org/traccar/reports/ReportUtils.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index f0d6d40c2..e04f2f90c 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -191,8 +191,9 @@ public final class ReportUtils {
trip.setStartLon(startTrip.getLongitude());
trip.setStartTime(startTrip.getFixTime());
String startAddress = startTrip.getAddress();
- if (startAddress == null && Context.getConfig().getBoolean("report.retryGeocoding")) {
- startAddress = Context.getGeocoder().getAddress(startTrip.getLatitude(), startTrip.getLongitude());
+ if (startAddress == null && Context.getGeocoder() != null
+ && Context.getConfig().getBoolean("geocoder.onRequest")) {
+ startAddress = Context.getGeocoder().getAddress(startTrip.getLatitude(), startTrip.getLongitude(), null);
}
trip.setStartAddress(startAddress);
@@ -201,8 +202,9 @@ public final class ReportUtils {
trip.setEndLon(endTrip.getLongitude());
trip.setEndTime(endTrip.getFixTime());
String endAddress = endTrip.getAddress();
- if (endAddress == null && Context.getConfig().getBoolean("report.retryGeocoding")) {
- endAddress = Context.getGeocoder().getAddress(startTrip.getLatitude(), startTrip.getLongitude());
+ if (endAddress == null && Context.getGeocoder() != null
+ && Context.getConfig().getBoolean("geocoder.onRequest")) {
+ endAddress = Context.getGeocoder().getAddress(endTrip.getLatitude(), endTrip.getLongitude(), null);
}
trip.setEndAddress(endAddress);
@@ -233,8 +235,9 @@ public final class ReportUtils {
stop.setLongitude(startStop.getLongitude());
stop.setStartTime(startStop.getFixTime());
String address = startStop.getAddress();
- if (address == null && Context.getConfig().getBoolean("report.retryGeocoding")) {
- address = Context.getGeocoder().getAddress(stop.getLatitude(), stop.getLongitude());
+ if (address == null && Context.getGeocoder() != null
+ && Context.getConfig().getBoolean("geocoder.onRequest")) {
+ address = Context.getGeocoder().getAddress(stop.getLatitude(), stop.getLongitude(), null);
}
stop.setAddress(address);