Kia ora - hello from Aotearoa New Zealand
I was very fortunate to meet Grega Milcinski when he spoke at the “What on Earth” colloquium held at Te Papa, Wellington recently. Before he showed the use of the Sentinel-Playground, I had been downloading whole scenes from the US Geological Survey’s EarthExplorer, then processing layers through a geospatial raster calculator (in Quantum GIS) to then return a Normalised Difference Vegetation Index (NDVI) product. The Sentinel Playground is a real step up in democratising earth observation data; full credit to the Sinergise team.
I asked Grega if the colours of the NDVI product could be standardised - “have I got my colours correct?” rI also ask as some gentlemen are colour-blind, so I need to ensure that the graphic is telling the true story about the data]. Grega’s informative reply included this piece of code, which it’s straightforward to use (Thank you Grega!)
"Code:
let ndvi = (B08 - B04) / (B08 + B04);
if (ndvi<-0.2) return ;0,0,0];
else if (ndvi<-0.1) return ;1,0,0];
else if (ndvi<0) return &0.5,0.6,0,0];
else if (ndvi<0.1) return t0.4,0,0];
else if (ndvi<0.2) return t1,1,0.2];
else if (ndvi<0.3) return t0.8,0.8,0.2]; else if (ndvi<0.4) return t0.4,0.4,0]; else if (ndvi<0.5) return t0.2,1,1]; else if (ndvi<0.6) return t0.2,0.8,0.8]; else if (ndvi<0.7) return t0,0.4,0.4]; else if (ndvi<0.8) return t0.2,1,0.2]; else if (ndvi<0.9) return t0.2,0.8,0.2]; else return ;0,0.4,0];
You can find some other visualisation options for NDVI here:
https://github.com/sentinel-hub/custom-scripts/blob/master/sentinel-2/ndvi/script.js"
Ngā mihi
Gordon