Hello,
I want to have multi temporal scene classification, is it possible ? I saw it is done for min or max ndvi band but there is no resource for scene classification. I tried to do it by myself and here my evalscript;
//VERSION=3
function RGBToColor (r, g, b,dataMask){
return [r/255, g/255, b/255,dataMask];
}
function setup() {
return {
input: ["SCL","dataMask"],
output: { bands: 4 },
mosaicking:"ORBIT"
};
}
function filterScenes (scenes, inputMetadata) {
return scenes.filter(function (scene) {
//Here we limit data between "(TO date - 1 month) to (TO date)
return scene.date.getTime()>=(inputMetadata.to.getTime()-1*31*24*3600*1000) ;
});
}
function evaluatePixel(samples) {
// Not-vegetated (dark yellow)
var px = RGBToColor (255, 230, 90,samples.dataMask);
for (var i=0;i<samples.length;i++) {
var SCL=samples[i].SCL;
switch (SCL) {
// Vegetation (green)
case 4: return RGBToColor (0, 160, 0,samples.dataMask);
}
}
return px
}
I don’t know why but it does not work.
Note: I am so new to satellite datas and evalscript
thanks…