From 1efc6e38ed821435b2a46976c4d24a07d3811a63 Mon Sep 17 00:00:00 2001 From: misaochan Date: Wed, 6 Jan 2016 19:07:21 +1300 Subject: [PATCH] Tidied CacheController code --- .../fr/free/nrw/commons/caching/CacheController.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/commons/src/main/java/fr/free/nrw/commons/caching/CacheController.java b/commons/src/main/java/fr/free/nrw/commons/caching/CacheController.java index 30c03ec97..acbc28106 100644 --- a/commons/src/main/java/fr/free/nrw/commons/caching/CacheController.java +++ b/commons/src/main/java/fr/free/nrw/commons/caching/CacheController.java @@ -10,9 +10,7 @@ import fr.free.nrw.commons.upload.MwVolleyApi; public class CacheController { - private Context context; - private double x; - private double y; + private double x, y; private QuadTree quadTree; private Point[] pointsFound; private double xMinus, xPlus, yMinus, yPlus; @@ -21,7 +19,6 @@ public class CacheController { quadTree = new QuadTree(-180, -90, +180, +90); } - public void setQtPoint(double decLongitude, double decLatitude) { x = decLongitude; y = decLatitude; @@ -29,7 +26,6 @@ public class CacheController { Log.d("Cache", "X (longitude) value: " + x + ", Y (latitude) value: " + y); } - public void cacheCategory() { List pointCatList = new ArrayList(); @@ -44,7 +40,7 @@ public class CacheController { public List findCategory() { - //Convert decLatitude and decLongitude to a coordinate offset range + //Convert decLatitude and decLongitude to a coordinate offset range convertCoordRange(); pointsFound = quadTree.searchWithin(xMinus, yMinus, xPlus, yPlus); List displayCatList = new ArrayList(); @@ -76,11 +72,9 @@ public class CacheController { //Earth’s radius, sphere double radius=6378137; - //offsets in meters double offset = 100; - //Coordinate offsets in radians double dLat = offset/radius; double dLon = offset/(radius*Math.cos(Math.PI*lat/180));