-
Exercise Submission Error
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] };
}
Sorry, there were no replies found.