NDVI value for bbox center pixel


I couldn’t find how to get the NDVI value of bbox center pixel. I keep getting values from 0.1 to 0.99 also in no vegetation area.

My request:

GetMap seems to get the correct area:


Hi Oswaldo,

Looking at you calls and layers, I have noted the following:

  • Your GetFeatureInfo and GetMap call are not calling the same layers: you have NDVI and NDVI_NEW

  • NDVI is a layer which returns a visualisation of NDVI for SCL= vegetation + RGB for other surface types,

  • NDVI_NEW returns a visualisation (RGB) of NDVI, but you are only returning the first 2 values.

Therefore, in the URLS that you have posted, you are returning visualisation values and not actual NDVI values. If you want the “real” NDVI layer, I would recommend you add a layer in your configuration with the following Evalscript:


function setup() {
  return {
    input: ["B08", "B04"],
    output: { bands: 1, sampleType: "FLOAT32"}

function evaluatePixel(sample) {
  var ndvi = index(sample.B08, sample.B04);
  return [ndvi];

Running GetFeatureInfo on this layer should return NDVI.