GEE(Google Earth Engine)批量导入谷歌云盘

GEE run跑出结果,F12打开浏览器的Console,输入以下代码,即可批量导入谷歌云盘

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();
    }
            
}


function specifyFolder()
{
    var inputfloderlist = document.getElementsByClassName('jfk-textinput drive-folder');
    for (var i=0;i<inputfloderlist.length;i++)
    {
        inputfloderlist[i].value='TestFolder';
    }
}

function confirmAll() 
{
    var ok = document.getElementsByClassName('goog-buttonset-default goog-buttonset-action');
    for (var i = 0; i < ok.length; i++)
    {
        ok[i].click();
    }
        
}

runTaskList();
specifyFolder();
confirmAll();

批量取消

function runTaskList() {
    var tasklist = document.getElementsByClassName('indicator');
    for (var i = 0; i < tasklist.length; i++)
        tasklist[i].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();

2021.09.17
先运行

function runTaskList() {
    var runButtons = document.querySelector('#task-pane').shadowRoot.querySelectorAll(".run-button")
     runButtons.forEach(function(e) {e.click()})
}
runTaskList()

再运行

setTimeout( 
    function(){
       var taskDialog = document.querySelectorAll("ee-image-config-dialog") //table的话-image-改成-table-
        taskDialog.forEach(function(e) {e.shadowRoot.querySelector("ee-dialog").shadowRoot.querySelector("paper-dialog").querySelector(".ok-button").click()})
 },5 * 1000 );  

另一版

runTasks = function() {
    const evt = new MouseEvent('click', {bubbles: true, cancelable: true, ctrlKey: true})
    $$('.run-button' ,$$('ee-task-pane')[0].shadowRoot).forEach(function(e) {
        e.dispatchEvent(evt)
    })
}

runTasks()

参考链接:
https://blog.csdn.net/mrzhy1/article/details/111959855
https://blog.csdn.net/qq_21567935/article/details/89061114
https://groups.google.com/g/google-earth-engine-developers/c/-MMukxVsRJI/m/7Y2eC8UoAQAJ?utm_medium=email&utm_source=footer

你可能感兴趣的:(笔记,google,earth)