aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-15 22:53:37 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-15 22:53:37 +1200
commit7c97c2b3807977765007ca00161513b56acd8548 (patch)
tree1b30a41768a6581335ec02caaabff8ce613e353b /src
parent920ce00f759b60f0a186e6cd3a5c599cd051f3f3 (diff)
downloadtrackermap-server-7c97c2b3807977765007ca00161513b56acd8548.tar.gz
trackermap-server-7c97c2b3807977765007ca00161513b56acd8548.tar.bz2
trackermap-server-7c97c2b3807977765007ca00161513b56acd8548.zip
Change gisgraphy reverse geocoder (#1871)
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/geocode/GisgraphyReverseGeocoder.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/org/traccar/geocode/GisgraphyReverseGeocoder.java b/src/org/traccar/geocode/GisgraphyReverseGeocoder.java
index ef9209fca..18f59c7b0 100644
--- a/src/org/traccar/geocode/GisgraphyReverseGeocoder.java
+++ b/src/org/traccar/geocode/GisgraphyReverseGeocoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 - 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,7 +20,7 @@ import javax.json.JsonObject;
public class GisgraphyReverseGeocoder extends JsonReverseGeocoder {
public GisgraphyReverseGeocoder() {
- this("http://services.gisgraphy.com/street/streetsearch", 0);
+ this("http://services.gisgraphy.com/reversegeocoding/search", 0);
}
public GisgraphyReverseGeocoder(String url, int cacheSize) {
@@ -33,11 +33,14 @@ public class GisgraphyReverseGeocoder extends JsonReverseGeocoder {
JsonObject result = json.getJsonArray("result").getJsonObject(0);
- if (result.containsKey("name")) {
- address.setStreet(result.getString("name"));
+ if (result.containsKey("streetName")) {
+ address.setStreet(result.getString("streetName"));
}
- if (result.containsKey("isIn")) {
- address.setSettlement(result.getString("isIn"));
+ if (result.containsKey("city")) {
+ address.setSettlement(result.getString("city"));
+ }
+ if (result.containsKey("state")) {
+ address.setState(result.getString("state"));
}
if (result.containsKey("countryCode")) {
address.setCountry(result.getString("countryCode"));