From 7c97c2b3807977765007ca00161513b56acd8548 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 15 Apr 2016 22:53:37 +1200 Subject: Change gisgraphy reverse geocoder (#1871) --- src/org/traccar/geocode/GisgraphyReverseGeocoder.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') 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")); -- cgit v1.2.3