aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/Context.java2
-rw-r--r--src/org/traccar/geocoder/GeocodeFarmGeocoder.java10
-rw-r--r--src/org/traccar/geocoder/NominatimGeocoder.java1
3 files changed, 9 insertions, 4 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 27e61d32d..daabb8c32 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -232,7 +232,7 @@ public final class Context {
geocoder = new FactualGeocoder(url, key, cacheSize);
break;
case "geocodefarm":
- geocoder = new GeocodeFarmGeocoder(key, cacheSize);
+ geocoder = new GeocodeFarmGeocoder(key, language, cacheSize);
break;
default:
geocoder = new GoogleGeocoder(key, language, cacheSize);
diff --git a/src/org/traccar/geocoder/GeocodeFarmGeocoder.java b/src/org/traccar/geocoder/GeocodeFarmGeocoder.java
index db23aab79..73ff85aa4 100644
--- a/src/org/traccar/geocoder/GeocodeFarmGeocoder.java
+++ b/src/org/traccar/geocoder/GeocodeFarmGeocoder.java
@@ -19,15 +19,19 @@ import javax.json.JsonObject;
public class GeocodeFarmGeocoder extends JsonGeocoder {
- private static String formatUrl(String key) {
+ private static String formatUrl(String key, String language) {
String url = "https://www.geocode.farm/v3/json/reverse/";
+ url += "?lat=%f&lon=%f&country=us&count=1";
if (key != null) {
url += "&key=" + key;
}
+ if (language != null) {
+ url += "&lang=" + language;
+ }
return url;
}
- public GeocodeFarmGeocoder(String key, int cacheSize) {
- super(formatUrl(key), cacheSize);
+ public GeocodeFarmGeocoder(String key, String language, int cacheSize) {
+ super(formatUrl(key, language), cacheSize);
}
@Override
diff --git a/src/org/traccar/geocoder/NominatimGeocoder.java b/src/org/traccar/geocoder/NominatimGeocoder.java
index c10a1414e..4f33468fd 100644
--- a/src/org/traccar/geocoder/NominatimGeocoder.java
+++ b/src/org/traccar/geocoder/NominatimGeocoder.java
@@ -23,6 +23,7 @@ public class NominatimGeocoder extends JsonGeocoder {
if (url == null) {
url = "http://nominatim.openstreetmap.org/reverse";
}
+ url += "?format=json&lat=%f&lon=%f&zoom=18&addressdetails=1";
if (key != null) {
url += "&key=" + key;
}