I am downloading Sentinel-2 L2A imagery as PNG with a simple truecolor script.
In rare cases a WCS request returns a PNG that is valid and have a proper size but have only one color (black).
If I retry the request later, the same request returns a proper image (multiple colors).
If I request WFS GetFeature after WCS request gave a bad image, I got a sane-looking data with proper dates.
It happens maybe in 1% of requests every day after fresh satellite data arrives.
At my example I had requested image (bad.png) 15 hours after image was processed according to WFS.
Next day I repeated the original WCS request and got a good image (good.png).
Requests and script are probably okay because they work 99% time with different places.
Image was taken at “date”: “2020-08-08”, “time”: “05:56:58” and located in two tiles
Image first requested on the same day at 19:10 UTC.
evalScript
//VERSION=3 (auto-converted from 1)
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, samples.dataMask];
return viz.processList(val);
}
function setup() {
return {
input: [{bands: ["B02", "B03", "B04", "dataMask" ] }],
output: { bands: 4 }
}}
It seems to me that you are requesting WFS data on Sentinel-2 L1C dataset and actual data on Sentinel-2 L2A dataset. Am I right?
This would explain your issue - in general L2A is available a couple of hours after L1C but sometimes it takes longer to appear.
Thank you for the suggestion, it was really L1C in the WFS request. I had not paid enough attention to “S2.TILE” part. I tried it with DSS2, and it works fine.
I perform the search in area of interest (bbox) using the WFS API. Does the Catalogue service provide more information about data inside the area compared to WFS?
The data included in one and another is somehow similar, but Catalogue API has much better ways to get these data out. E.g. if you just need dates in some area: