private boolean incr(double wantLat, double wantLon, int[] rectIndex) { int row = rectIndex[0]; int col = rectIndex[1]; double diffLat = wantLat - latEdge.get(row, col); double diffLon = wantLon - lonEdge.get(row, col); if (Math.abs(diffLat) > Math.abs(diffLon)) { // try lat first rectIndex[0] = row + ((diffLat > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; rectIndex[1] = col + ((diffLon > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; } else { rectIndex[1] = col + ((diffLon > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; rectIndex[0] = row + ((diffLat > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; } // back to original, do box search rectIndex[0] = row; rectIndex[1] = col; return box9(wantLat, wantLon, rectIndex); }
private boolean incr(double wantLat, double wantLon, int[] rectIndex) { int row = rectIndex[0]; int col = rectIndex[1]; double diffLat = wantLat - latEdge.get(row, col); double diffLon = wantLon - lonEdge.get(row, col); if (Math.abs(diffLat) > Math.abs(diffLon)) { // try lat first rectIndex[0] = row + ((diffLat > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; rectIndex[1] = col + ((diffLon > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; } else { rectIndex[1] = col + ((diffLon > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; rectIndex[0] = row + ((diffLat > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; } // back to original, do box search rectIndex[0] = row; rectIndex[1] = col; return box9(wantLat, wantLon, rectIndex); }
private boolean incr(double wantLat, double wantLon, int[] rectIndex) { int row = rectIndex[0]; int col = rectIndex[1]; double diffLat = wantLat - latEdge.get(row, col); double diffLon = wantLon - lonEdge.get(row, col); if (Math.abs(diffLat) > Math.abs(diffLon)) { // try lat first rectIndex[0] = row + ((diffLat > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; rectIndex[1] = col + ((diffLon > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; } else { rectIndex[1] = col + ((diffLon > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; rectIndex[0] = row + ((diffLat > 0) ? 1 : -1); if (contains(wantLat, wantLon, rectIndex)) return true; } // back to original, do box search rectIndex[0] = row; rectIndex[1] = col; return box9(wantLat, wantLon, rectIndex); }