diff options
Diffstat (limited to 'src/org/traccar/GeocoderHandler.java')
-rw-r--r-- | src/org/traccar/GeocoderHandler.java | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/org/traccar/GeocoderHandler.java b/src/org/traccar/GeocoderHandler.java index c5f4d2f9a..2742ff1a7 100644 --- a/src/org/traccar/GeocoderHandler.java +++ b/src/org/traccar/GeocoderHandler.java @@ -22,7 +22,6 @@ 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.DistanceCalculator; import org.traccar.helper.Log; import org.traccar.model.Position; @@ -62,10 +61,7 @@ public class GeocoderHandler implements ChannelUpstreamHandler { if (geocoderReuseDistance != 0) { Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId()); if (lastPosition != null && lastPosition.getAddress() != null) { - double distance = DistanceCalculator.distance( - position.getLatitude(), position.getLongitude(), - lastPosition.getLatitude(), lastPosition.getLongitude()); - if (distance <= geocoderReuseDistance) { + if (position.getDouble(Position.KEY_DISTANCE) <= geocoderReuseDistance) { position.setAddress(lastPosition.getAddress()); Channels.fireMessageReceived(ctx, position, event.getRemoteAddress()); return; |