--- dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/GeoPoint.java 2015/06/11 20:10:23 2577 +++ dao/FuldDaekningWorker/src/dk/daoas/fulddaekning/GeoPoint.java 2015/06/11 20:39:28 2578 @@ -12,8 +12,10 @@ latitude=lat; longitude=lng; } - - public static double beregnAfstand(GeoPoint point1, GeoPoint point2) { + + //Denne er alt for upræcis + @Deprecated + public static double beregnAfstand_old(GeoPoint point1, GeoPoint point2) { //(62.8*sqrt(3.1*(Power(a.Latitude-x.Latitude,2)+Power(a.Longitude-x.Longitude,2)))) as Afstand, @@ -23,13 +25,12 @@ return 62.8 * Math.sqrt( 3.1 * (pwrLat + pwrLng) ); } - public static float beregnAfstand2(GeoPoint p1, GeoPoint p2) { + public static float beregnAfstand(GeoPoint p1, GeoPoint p2) { float[] result = new float[1]; - - computeDistanceAndBearing(p1.latitude, p1.longitude, p2.latitude, p2.longitude, result); + computeDistanceAndBearing(p1.latitude, p1.longitude, p2.latitude, p2.longitude, result); - return result[0]; + return (result[0] / 1000.0f); }