Skip to main content

Good Day,


I am currently trying to use the request builder OGC NDVI layer with my own custom script as below:

let ndvi = (B08 - B04) / (B08 + B04);

if (ndvi >= 0 && ndvi < 0.2) return [208, 0, 0];

else if (ndvi >= 0.2 && ndvi < 0.3) return [249, 72, 75];

else if (ndvi >= 0.3 && ndvi < 0.4) return [255, 158, 74];

else if (ndvi >= 0.4 && ndvi < 0.5) return [254, 207, 50];

else if (ndvi >= 0.5 && ndvi < 0.6) return [253, 255, 0];

else if (ndvi >= 0.6 && ndvi < 0.7) return [139, 238, 16];

else if (ndvi >= 0.7 && ndvi < 0.8) return [39, 192, 75];

else return [39, 192, 75];


However, every time I run the request it gives me the following error no matter how small or big the bounding box is:


The format type is application/json format.


I am unsure how to rectify this issue as it was working on a trial account of my own, but when I switched to the product owners account which he set up and tried using it, it has been giving me the above mentioned issue.


Kind Regards

Hi Thinus,


Application/json is not a supported format on WMS GetMap requests. We will remove it from Requests builder since it’s misleading.


In case you want to retrieve JSON statistics on a given area of intereset I recommend you to take a look at FIS which does return JSON.


Sorry for the inconvenience and have a good day,


Ignasi Espinosa


Hi Ignasi,


When I use the OGC API and WMS/WCS service, it does return a application/json response.


However, certain times it does work and certain times it does not.


After the entire day today, it seems to be working. It returns a JSON.


I am currently using a C# REST API, how would I would get the NDVI values of a selected area when using FIS?


Kind Regards


Hi Ignasi,


It has been working since 1pm today till 3pm and now it started with that error again. So at times it works and does not?


Will this API be removed entirely? If so, how will I be able to get a specified bounding box area’s GeoJSON and NDVI values that I can use it to visualize and provide a color scheme for each value?


Kind Regards


Reply