diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-03-23 21:07:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-03-23 21:07:56 +1300 |
commit | 23086613c6e88aa768afa795340fe9ac0ac3a7db (patch) | |
tree | 9536d308574a113215a58f3d1d24ec15618ef855 /src/org/traccar/ServerManager.java | |
parent | 35701e0a14782d67320a7c667d7afd980bbc5dd0 (diff) | |
download | trackermap-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.java | 9 |
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(); + } } } |