I wonder if I am doing something wrong or what?! I should also mention that for other areas the result is OK.
Interestingly, others have done for the same area with the same interval and the result is fine.
evalscript_true_color = “”"
//VERSION=3
function setup() {
return {
input: [{
bands: [“B02”,“B03”,“B04”,“dataMask”]
}],
output: {
bands: 3
}
};
}
let minVal = 0.0;
let maxVal = 0.4;
let viz = new HighlightCompressVisualizer(minVal, maxVal);
function evaluatePixel(samples) {
let val = [samples.B04, samples.B03, samples.B02];
val = viz.processList(val);
val.push(samples.dataMask);
return val;
}
"""
request_true_color = SentinelHubRequest(
data_folder='./outputs',
evalscript=evalscript_true_color,
input_data=[
SentinelHubRequest.input_data(
data_source=DataSource.SENTINEL2_L2A,
time_interval=('2020-04-01', '2020-06-30'),
mosaicking_order='leastCC'
)
],
responses=[
SentinelHubRequest.output_response('default', MimeType.TIFF)
],
bbox=betsiboka_bbox,
size=betsiboka_size,
config=config
)
There is nothing wrong with your script. What you are seeing in the left part of your image is snow on the ground mixed with a few clouds. It looks a bit strange because you are using the HighlightCompressVisualizer, a linear function that compresses highlights.
At the location you are querying, there is an overlap in the tiles, and you have selected the leastCC option, which selects the least cloudy image of the overlapping tiles. Snow is not considered as clouds, and since your time range covers April (where there is snow on the ground), you get the result you posted. If you were to select the mostRecentmosaicking option in association with a lower cloud cover threshold (say 10%), you would get an image without snow:
The parameter settings mostRecent and leastRecent are time-related and are not taking cloud cover metadata into account. So if you use mostRecent, the request will return the latest imagery in your time interval that meets the other criteria you specified, e.g. maximum cloud cover. On the other hand, leastRecent will return the “oldest” image data depending on the given time interval.
In order to filter for the least cloudy image tiles, you would have to use leastCC which filters the tiles based on metadata of the respective acquisition. Please note that this information is provided for the whole tile of 12,000 sqkm and does not mean that this is necessarily the best option for your area of interest.
Based on what you said, I found out that as we have smaller tiles we can get better result. In this case, eo-learn is a better choice to make least cloudy mosaic image since we can determine the size of the tiles.