From 6b2b797e92aa885792f82211935eac7edbcf15a9 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 9 Feb 2012 09:25:20 +0200 Subject: [PATCH] we normalize lat, TODO not needed --- .../org/elasticsearch/index/search/geo/GeoDistance.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/search/geo/GeoDistance.java b/src/main/java/org/elasticsearch/index/search/geo/GeoDistance.java index dbedbe638cd..719a50c9001 100644 --- a/src/main/java/org/elasticsearch/index/search/geo/GeoDistance.java +++ b/src/main/java/org/elasticsearch/index/search/geo/GeoDistance.java @@ -24,8 +24,6 @@ import org.elasticsearch.common.unit.DistanceUnit; /** * Geo distance calculation. - * - * */ public enum GeoDistance { /** @@ -55,7 +53,6 @@ public enum GeoDistance { FACTOR() { @Override public double calculate(double sourceLatitude, double sourceLongitude, double targetLatitude, double targetLongitude, DistanceUnit unit) { - // TODO: we might want to normalize longitude as we did in LatLng... double longitudeDifference = targetLongitude - sourceLongitude; double a = Math.toRadians(90D - sourceLatitude); double c = Math.toRadians(90D - targetLatitude); @@ -78,7 +75,6 @@ public enum GeoDistance { ARC() { @Override public double calculate(double sourceLatitude, double sourceLongitude, double targetLatitude, double targetLongitude, DistanceUnit unit) { - // TODO: we might want to normalize longitude as we did in LatLng... double longitudeDifference = targetLongitude - sourceLongitude; double a = Math.toRadians(90D - sourceLatitude); double c = Math.toRadians(90D - targetLatitude); @@ -286,7 +282,6 @@ public enum GeoDistance { @Override public double calculate(double targetLatitude, double targetLongitude) { - // TODO: we might want to normalize longitude as we did in LatLng... double longitudeDifference = targetLongitude - sourceLongitude; double c = Math.toRadians(90D - targetLatitude); return (cosA * Math.cos(c)) + (sinA * Math.sin(c) * Math.cos(Math.toRadians(longitudeDifference))); @@ -315,7 +310,6 @@ public enum GeoDistance { @Override public double calculate(double targetLatitude, double targetLongitude) { - // TODO: we might want to normalize longitude as we did in LatLng... double longitudeDifference = targetLongitude - sourceLongitude; double c = Math.toRadians(90D - targetLatitude); double factor = (cosA * Math.cos(c)) + (sinA * Math.sin(c) * Math.cos(Math.toRadians(longitudeDifference)));