发布时间:2024-02-21 19:30
GEE已经优化了界面,在task manager中可直接一键批量取消任务。
From:
https://gis.stackexchange.com/questions/290771/batch-task-execution-in-google-earth-engine
注意
getElementsByClassName(‘task local type-EXPORT_IMAGE awaiting-user-config’);
记得修改Elements的名字!
// An highlighted block
/**
* 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
*/
function runTaskList(){
var tasklist = document.getElementsByClassName('task local type-EXPORT_FEATURES awaiting-user-config');
for (var i = 0; i < tasklist.length; i++)
tasklist[i].getElementsByClassName('run-button')[0].click();
}
function confirmAll() {
var ok = document.getElementsByClassName('goog-buttonset-default goog-buttonset-action');
for (var i = 0; i < ok.length; i++)
ok[i].click();
}
runTaskList();
confirmAll();
/* cancel task 依葫芦画瓢*/
function cancelTaskList(){
var tasklist = document.getElementsByClassName('task local type-EXPORT_FEATURES submitted-to-backend');
for (var i = 0; i < tasklist.length; i++)
tasklist[i].getElementsByClassName('indicator')[0].click();
}
function confirmAll() {
var ok = document.getElementsByClassName('goog-buttonset-default goog-buttonset-action');
for (var i = 0; i < ok.length; i++)
ok[i].click();
}
cancelTaskList();
confirmAll();