aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-03-23 21:07:56 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-03-23 21:07:56 +1300
commit23086613c6e88aa768afa795340fe9ac0ac3a7db (patch)
tree9536d308574a113215a58f3d1d24ec15618ef855 /src/org/traccar/ServerManager.java
parent35701e0a14782d67320a7c667d7afd980bbc5dd0 (diff)
downloadtrackermap-server-23086613c6e88aa768afa795340fe9ac0ac3a7db.tar.gz
trackermap-server-23086613c6e88aa768afa795340fe9ac0ac3a7db.tar.bz2
trackermap-server-23086613c6e88aa768afa795340fe9ac0ac3a7db.zip
Add Nominatim reverse geocoding (fix #615)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 4e5b283d4..1dfe5e3d6 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -36,6 +36,7 @@ import org.jboss.netty.handler.codec.http.HttpResponseEncoder;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;
import org.traccar.geocode.GoogleReverseGeocoder;
+import org.traccar.geocode.NominatimReverseGeocoder;
import org.traccar.geocode.ReverseGeocoder;
import org.traccar.helper.Log;
import org.traccar.http.WebServer;
@@ -199,7 +200,13 @@ public class ServerManager {
private void initGeocoder(Properties properties) throws IOException {
if (Boolean.parseBoolean(properties.getProperty("geocoder.enable"))) {
- reverseGeocoder = new GoogleReverseGeocoder();
+ String type = properties.getProperty("geocoder.type");
+ if (type != null && type.equals("nominatim")) {
+ reverseGeocoder = new NominatimReverseGeocoder(
+ getProperties().getProperty("geocoder.url"));
+ } else {
+ reverseGeocoder = new GoogleReverseGeocoder();
+ }
}
}