I want to get an RGB image for my co-ordinates using the API, I use the following evalscript for that:
minVal = 0.0;
let maxVal = 0.4;
let viz = new HighlightCompressVisualizer(minVal, maxVal);
function evaluatePixel(samples) {
let val = [samples[0].B04, samples[0].B03, samples[0].B02];
return viz.processList(val);
}
function setup(ds) {
setInputComponents([ds.B02, ds.B03, ds.B04]);
setOutputComponentCount(3);
}
Which gives me following error:
{"error":{"status":400,"reason":"Bad Request","message":"Script failed to return.","code":"RENDERER_EXCEPTION"}}
I have made sure everything else is fine. I think there’s something wrong with the evalscript.
This script looks good to me and if I go to Sentinel Playground, click Custom and then Advance (yellow switch) and input this code, it works just fine.
I’m using process API, l just added //VERSION=3 at the top and the error seems pretty much explainable now.
{"error":{"status":400,"reason":"Bad Request","message":"Failed to evaluate script!\\nevalscript.js:13: ReferenceError: setInputComponents is not defined\\n setInputComponents([ds.B02, ds.B03, ds.B04]); \\n ^\\nReferenceError: setInputComponents is not defined\\n at setup (evalscript.js:13:5)\\n","code":"RENDERER_EXCEPTION"}}