I use the following request to get the ndvi tiff image, and it worked well so far:
http://services.sentinel-hub.com/ogc/wms/{myapikey}?SERVICE=WMS&REQUEST=GetMap&SHOWLOGO=false&VERSION=1.3.0&LAYERS=EVI-RAINBOW&MAXCC=20&RESX=1m&RESY=1m&CRS=EPSG:4326&BBOX=-36.3809959294701,145.29668703826,-36.3834902315857,145.298261989762&FORMAT=image/tiff&TIME=2020-11-01
Few months ago, I started getting tiff images only in grayscale, for the same request.
Does anybody know, how can I get an image in rainbow colors?
Note: If you want test my request, please just fill your api key on the {myapikey}.
Hi @milos.zinajic,
I tested your request, opened the tiff image in Qgis and I get this (I presume this image looks like what you expected) :
For the EVI-RAINBOW layer, I used this evalscript:
//VERSION=3
let viz = ColorGradientVisualizer.createBlueRed();
function evaluatePixel(samples) {
let val = 2.5 * (samples.B08 - samples.B04) / (samples.B08 + 6 * samples.B04 - 7.5 * samples.B02 + 1);
val = viz.process(val);
val.push(samples.dataMask);
return val;
}
function setup() {
return {
input: [{
bands: [
"B02",
"B04",
"B08",
"dataMask"
]
}],
output: {
bands: 4
}
}
}
I hope it helps,
Best,
Dorothy
@dorothyrono, thanks for the answer, that is the color I want to achieve.
Howewer, I have no idea how can I achieve this from c#.
Is there any way to get an image directly in rainbow color?
@milos.zinajic
I am sorry I know nothing about c#. I can’t help there
But if you want to use the same request you sent above to get the tiff images in rainbow colors, you will first need to create EVI-RAINBOW layer in your configuration.
Here is how you can create it. https://www.sentinel-hub.com/develop/dashboard/
I am sorry if I didn’t understand your question well.
Just let me know if you still need help.
Best
Dorothy
@dorothyrono, thanks a lot, I didn’t know about develop/dashboard part, I took over the project from my colleagues who obviously did it.
When I logged in there I found the following info:
Scripts and products converted to V3.
All V1 and V2 evalscripts have been automatically converted to V3 on November 2, 2020.
That is actually a date I started receiving grayscale pictures.
I’ll try to fix it according to your script, so if I there is a problem, I will write to you.
Thanks!
All the best !
Let us know if you get stuck