aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/geocode/NominatimReverseGeocoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-30 13:57:03 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-30 13:57:03 +1300
commita045472079bb83bb318605d65bac45bb575b29c3 (patch)
tree9da9e32108ba2d1f4fad6ddc0c854707f3e84eef /src/org/traccar/geocode/NominatimReverseGeocoder.java
parentbe088ea967dfe7d1a7de3ec824382afc92aab128 (diff)
downloadtrackermap-server-a045472079bb83bb318605d65bac45bb575b29c3.tar.gz
trackermap-server-a045472079bb83bb318605d65bac45bb575b29c3.tar.bz2
trackermap-server-a045472079bb83bb318605d65bac45bb575b29c3.zip
Add suburb to address class
Diffstat (limited to 'src/org/traccar/geocode/NominatimReverseGeocoder.java')
-rw-r--r--src/org/traccar/geocode/NominatimReverseGeocoder.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/org/traccar/geocode/NominatimReverseGeocoder.java b/src/org/traccar/geocode/NominatimReverseGeocoder.java
index 933d9389c..c1481d1cb 100644
--- a/src/org/traccar/geocode/NominatimReverseGeocoder.java
+++ b/src/org/traccar/geocode/NominatimReverseGeocoder.java
@@ -40,15 +40,24 @@ public class NominatimReverseGeocoder extends JsonReverseGeocoder {
if (result.containsKey("road")) {
address.setStreet(result.getString("road"));
}
+ if (result.containsKey("suburb")) {
+ address.setSuburb(result.getString("suburb"));
+ }
+
if (result.containsKey("village")) {
address.setSettlement(result.getString("village"));
- }
- if (result.containsKey("city")) {
+ } else if (result.containsKey("town")) {
+ address.setSettlement(result.getString("town"));
+ } else if (result.containsKey("city")) {
address.setSettlement(result.getString("city"));
}
+
if (result.containsKey("state_district")) {
address.setDistrict(result.getString("state_district"));
+ } else if (result.containsKey("region")) {
+ address.setDistrict(result.getString("region"));
}
+
if (result.containsKey("state")) {
address.setState(result.getString("state"));
}