Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
@Singleton
public class CacheController {

private final GpsCategoryModel gpsCategoryModel;
private final QuadTree<List<String>> quadTree;
private double x, y;
private double xMinus, xPlus, yMinus, yPlus;

private static final int EARTH_RADIUS = 6378137;

@Inject
CacheController(GpsCategoryModel gpsCategoryModel) {
this.gpsCategoryModel = gpsCategoryModel;
CacheController() {
quadTree = new QuadTree<>(-180, -90, +180, +90);
}

Expand All @@ -36,17 +34,6 @@ public void setQtPoint(double decLongitude, double decLatitude) {
Timber.d("X (longitude) value: %f, Y (latitude) value: %f", x, y);
}

public void cacheCategory() {
List<String> pointCatList = new ArrayList<>();
if (gpsCategoryModel.getGpsCatExists()) {
pointCatList.addAll(gpsCategoryModel.getCategoryList());
Timber.d("Categories being cached: %s", pointCatList);
} else {
Timber.d("No categories found, so no categories cached");
}
quadTree.set(x, y, pointCatList);
}

public List<String> findCategory() {
Point<List<String>>[] pointsFound;
//Convert decLatitude and decLongitude to a coordinate offset range
Expand Down