aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/geocode
diff options
context:
space:
mode:
authorHans van den Elsen <hans.elsen@esds.nl>2016-03-14 20:49:04 +0100
committerHans van den Elsen <hans.elsen@esds.nl>2016-03-14 20:49:04 +0100
commit7fd1c08dd2f789ddd37ff075a6ebda1645947616 (patch)
tree75b715e6dd70f6be3357e1710c4db6f1f6a1e29e /src/org/traccar/geocode
parent4606737cc07b736f9c8f98ae680b928c94c082c8 (diff)
parent0a1019b59481b6bf8ee8989feb23cef084b6caf5 (diff)
downloadtrackermap-server-7fd1c08dd2f789ddd37ff075a6ebda1645947616.tar.gz
trackermap-server-7fd1c08dd2f789ddd37ff075a6ebda1645947616.tar.bz2
trackermap-server-7fd1c08dd2f789ddd37ff075a6ebda1645947616.zip
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'src/org/traccar/geocode')
-rw-r--r--src/org/traccar/geocode/BingMapsReverseGeocoder.java4
-rw-r--r--src/org/traccar/geocode/FactualReverseGeocoder.java4
-rw-r--r--src/org/traccar/geocode/MapQuestReverseGeocoder.java4
-rw-r--r--src/org/traccar/geocode/OpenCageReverseGeocoder.java14
4 files changed, 10 insertions, 16 deletions
diff --git a/src/org/traccar/geocode/BingMapsReverseGeocoder.java b/src/org/traccar/geocode/BingMapsReverseGeocoder.java
index a5ebbd420..69148875a 100644
--- a/src/org/traccar/geocode/BingMapsReverseGeocoder.java
+++ b/src/org/traccar/geocode/BingMapsReverseGeocoder.java
@@ -20,10 +20,6 @@ import javax.json.JsonObject;
public class BingMapsReverseGeocoder extends JsonReverseGeocoder {
- public BingMapsReverseGeocoder() {
- this("http://dev.virtualearth.net/REST/v1", "ABCDE", 0);
- }
-
public BingMapsReverseGeocoder(String url, String key, int cacheSize) {
super(url + "/Locations/%f,%f?key=" + key + "&include=ciso2", cacheSize);
}
diff --git a/src/org/traccar/geocode/FactualReverseGeocoder.java b/src/org/traccar/geocode/FactualReverseGeocoder.java
index 6e5a48423..15211f74a 100644
--- a/src/org/traccar/geocode/FactualReverseGeocoder.java
+++ b/src/org/traccar/geocode/FactualReverseGeocoder.java
@@ -19,10 +19,6 @@ import javax.json.JsonObject;
public class FactualReverseGeocoder extends JsonReverseGeocoder {
- public FactualReverseGeocoder() {
- this("https://api.factual.com/geotag", "ABCDE", 0);
- }
-
public FactualReverseGeocoder(String url, String key, int cacheSize) {
super(url + "?latitude=%f&longitude=%f&KEY=" + key, cacheSize);
}
diff --git a/src/org/traccar/geocode/MapQuestReverseGeocoder.java b/src/org/traccar/geocode/MapQuestReverseGeocoder.java
index be3f51b04..93edfdd09 100644
--- a/src/org/traccar/geocode/MapQuestReverseGeocoder.java
+++ b/src/org/traccar/geocode/MapQuestReverseGeocoder.java
@@ -20,10 +20,6 @@ import javax.json.JsonObject;
public class MapQuestReverseGeocoder extends JsonReverseGeocoder {
- public MapQuestReverseGeocoder() {
- this("http://www.mapquestapi.com/geocoding/v1/reverse", "ABCDE", 0);
- }
-
public MapQuestReverseGeocoder(String url, String key, int cacheSize) {
super(url + "?key=" + key + "&location=%f,%f", cacheSize);
}
diff --git a/src/org/traccar/geocode/OpenCageReverseGeocoder.java b/src/org/traccar/geocode/OpenCageReverseGeocoder.java
index 3104cb56a..b5b31179e 100644
--- a/src/org/traccar/geocode/OpenCageReverseGeocoder.java
+++ b/src/org/traccar/geocode/OpenCageReverseGeocoder.java
@@ -1,5 +1,6 @@
/*
* Copyright 2014 - 2015 Stefaan Van Dooren (stefaan.vandooren@gmail.com)
+ * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +21,6 @@ import javax.json.JsonObject;
public class OpenCageReverseGeocoder extends JsonReverseGeocoder {
- public OpenCageReverseGeocoder() {
- this("https://api.opencagedata.com/geocode/v1", "ABCDE", 0);
- }
-
public OpenCageReverseGeocoder(String url, String key, int cacheSize) {
super(url + "/json?q=%f,%f&key=" + key, cacheSize);
}
@@ -36,12 +33,21 @@ public class OpenCageReverseGeocoder extends JsonReverseGeocoder {
if (location != null) {
Address address = new Address();
+ if (location.containsKey("building")) {
+ address.setHouse(location.getString("building"));
+ }
if (location.containsKey("house_number")) {
address.setHouse(location.getString("house_number"));
}
if (location.containsKey("road")) {
address.setStreet(location.getString("road"));
}
+ if (location.containsKey("suburb")) {
+ address.setSuburb(location.getString("suburb"));
+ }
+ if (location.containsKey("city")) {
+ address.setSettlement(location.getString("city"));
+ }
if (location.containsKey("city_district")) {
address.setSettlement(location.getString("city_district"));
}