Land in Focus – Hazards & Disasters

This is the official forum for the course "Land in Focus - Hazards & Disasters"

Discussion

Find answers, ask questions, and connect with our
community around the world.

Landing Page Hero Forums Land in Focus – Hazards & Disasters Exercise Submission Error

  • Exercise Submission Error

    Posted by KONSTANTINA VORGIOPOULOU on September 16, 2022 at 8:20 am

    I’m trying to submit my exercise results in the “Practical Part” of the Flood Mapping tutorial and when I click the “Submit your results” button a message keeps appearing: “Could not retrieve data from Cloud provider!”.

    I couldn’t fix it so I’m sending the results here.

    Exercise Results


    //VERSION=3

    const colorRamp = [[0.27,0x2079b5],[1,0x2079b5]]

    let viz = new ColorRampVisualizer(colorRamp);

    function setup() {

    return {

    input: [“B03″,”B11”, “dataMask”],

    output: [

    { id:”default”, bands: 4 },

    { id: “index”, bands: 1, sampleType: ‘FLOAT32’ }

    ]

    };

    }

    function evaluatePixel(samples) {

    let index = (samples.B03-samples.B11)/(samples.B03+samples.B11);

    const minIndex = 0.27;

    const maxIndex = 1;

    let visVal = null;

    if(index > maxIndex || index < minIndex) {

    visVal = [0, 0, 0, 0];

    }

    else {

    visVal = […viz.process(index),samples.dataMask];

    }

    // The library for tiffs only works well if there is one channel returned.

    // So here we encode “no data” as NaN and ignore NaNs on the frontend.

    const indexVal = samples.dataMask === 1 ? index : NaN;

    return { default: visVal, index: [indexVal] };

    }

    KONSTANTINA VORGIOPOULOU replied 2 weeks, 5 days ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.