Batch export Google Earth Engine (GEE) tasks with Tampermonkey.
- Tired of click GEE tasks run button in browser?
- Tired of translate
JavaScriptintopython, because ofJavaScriptinconvenient batch exporting? - Tired of paste JavaScript into console?
Tampermonkey can solve those problems!
- rAll : batch run all tasks
- rInv : batch run all tasks in inverse order
- cALL : cancel all tasks
- cSub : only cancel
submitted-to-backendtasks, and leaverunning-on-backendtasks - ntask: How many tasks to export? If not specified, it is all tasks.
to be continue
Tasks submitted to GEE have two kinds:
task submitted-to-backend: just submitted and waiting in the queuetask running-on-backend: submitted and running now (in skyblue backgroud)
-
2021年09月22日 (version 0.1.7)
- update for
task manager timeoutwas replaced withasync, which comes into effect forconfirm_allandrunAllin this version.
- update for
-
2020年08月14日 (version 0.1.5)
- fix user-box error
-
2019年09月17日 (version 0.1.4)
- add
rInvandntask
- add
-
2018年07月20日
running-on-backendtask's background is set to skyblue to distinguishsubmitted-to-backendtask.
https://gis.stackexchange.com/questions/290771/batch-task-execution-in-google-earth-engine
/** * Copyright (c) 2017 Dongdong Kong. All rights reserved. * This work is licensed under the terms of the MIT license. * For a copy, see <https://opensource.org/licenses/MIT>. * * Batch execute GEE Export task * * First of all, You need to generate export tasks. And run button was shown. * * Then press F12 get into console, then paste those scripts in it, and press * enter. All the task will be start automatically. * (Firefox and Chrome are supported. Other Browsers I didn't test.) * * @Author: * Dongdong Kong, 28 Aug' 2017, Sun Yat-sen University * yzq.yang, 17 Sep' 2021 */ function runTaskList(){ // var tasklist = document.getElementsByClassName('task local type-EXPORT_IMAGE awaiting-user-config'); // for (var i = 0; i < tasklist.length; i++) // tasklist[i].getElementsByClassName('run-button')[0].click(); $$('.run-button' ,$$('ee-task-pane')[0].shadowRoot).forEach(function(e) { e.click(); }) } function confirmAll() { // var ok = document.getElementsByClassName('goog-buttonset-default goog-buttonset-action'); // for (var i = 0; i < ok.length; i++) // ok[i].click(); $$('ee-table-config-dialog, ee-image-config-dialog').forEach(function(e) { var eeDialog = $$('ee-dialog', e.shadowRoot)[0] var paperDialog = $$('paper-dialog', eeDialog.shadowRoot)[0] $$('.ok-button', paperDialog)[0].click() }) } runTaskList(); confirmAll();
You need chrome and Tampermonkey (firefox is also OK).
You also can submit tasks by your phone with firefox and Tampermonkey.
- 1 Install Tampermonkey extension in
chromeorfirefox. - 2 Dashboard → New script → paste the script in gee_monkey → F5 refresh GEE website.