diff options
author | Abyss777 <abyss@fox5.ru> | 2017-11-08 15:43:13 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-11-08 15:43:13 +0500 |
commit | 404044342a9fc9891366fa4378b4b1330cbca6c3 (patch) | |
tree | 98a2bfc2b6998e006f874d30ee9976c68345fee1 /src/org/traccar/GeocoderHandler.java | |
parent | 92f00d0da0dafd08ccf2a623406963e61fcde276 (diff) | |
download | trackermap-server-404044342a9fc9891366fa4378b4b1330cbca6c3.tar.gz trackermap-server-404044342a9fc9891366fa4378b4b1330cbca6c3.tar.bz2 trackermap-server-404044342a9fc9891366fa4378b4b1330cbca6c3.zip |
- Implement synchronous geocoding
- Implement retry geocoding for trips/stops reports
- Implement API for revers geocoding
Diffstat (limited to 'src/org/traccar/GeocoderHandler.java')
-rw-r--r-- | src/org/traccar/GeocoderHandler.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/org/traccar/GeocoderHandler.java b/src/org/traccar/GeocoderHandler.java index a211d1a23..6b55e8162 100644 --- a/src/org/traccar/GeocoderHandler.java +++ b/src/org/traccar/GeocoderHandler.java @@ -20,7 +20,6 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ChannelUpstreamHandler; import org.jboss.netty.channel.Channels; import org.jboss.netty.channel.MessageEvent; -import org.traccar.geocoder.AddressFormat; import org.traccar.geocoder.Geocoder; import org.traccar.helper.Log; import org.traccar.model.Position; @@ -29,20 +28,12 @@ public class GeocoderHandler implements ChannelUpstreamHandler { private final Geocoder geocoder; private final boolean processInvalidPositions; - private final AddressFormat addressFormat; private final int geocoderReuseDistance; public GeocoderHandler(Geocoder geocoder, boolean processInvalidPositions) { this.geocoder = geocoder; this.processInvalidPositions = processInvalidPositions; - String formatString = Context.getConfig().getString("geocoder.format"); - if (formatString != null) { - addressFormat = new AddressFormat(formatString); - } else { - addressFormat = new AddressFormat(); - } - geocoderReuseDistance = Context.getConfig().getInteger("geocoder.reuseDistance", 0); } @@ -70,7 +61,7 @@ public class GeocoderHandler implements ChannelUpstreamHandler { Context.getStatisticsManager().registerGeocoderRequest(); - geocoder.getAddress(addressFormat, position.getLatitude(), position.getLongitude(), + geocoder.getAddress(position.getLatitude(), position.getLongitude(), new Geocoder.ReverseGeocoderCallback() { @Override public void onSuccess(String address) { |