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.

Home 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] };

    }

    Guadalupe Lovotti replied 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Guadalupe Lovotti

    Member
    February 18, 2024 at 1:01 am

    Hi Konstantia,

    I’m having the same problem in 2024. Were you able to continue the course by sending your code down here_ thanks in advance. Best reards!

Log in to reply.