NDVI value for bbox center pixel

Hello,

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:
https://services.sentinel-hub.com/ogc/wms/id?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&I=207&J=448&QUERY_LAYERS=NDVI&INFO_FORMAT=application/json&BBOX=-29.768227439663725,-55.812022710531956,-29.670704488715188,-55.7580904582724&CRS=EPSG:4326&MAXCC=100&WIDTH=414&HEIGHT=896&TIME=2022-1-25

GetMap seems to get the correct area:
https://services.sentinel-hub.com/ogc/wms/id?REQUEST=GetMap&BBOX=-29.768227439663725,-55.812022710531956,-29.670704488715188,-55.7580904582724&CRS=EPSG:4326&LAYERS=NDVI_NEW&MAXCC=20&WIDTH=414&HEIGHT=896&FORMAT=image/jpeg&TIME=2022-01-25

Thanks!!!

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:

//VERSION=3

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.