I am trying to sample 10 random points from each value in the 'QA60' band of a Sentinel-2 image for machine learning purposes. When I use the .stratifiedSample() function, I obtain an empty feature collection (0 lines and 23 columns). here is my code:
var s2 = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED"),
geometry =
/* color: #d63000 */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[-3.0637214179048367, 57.68153528540062],
[-3.0637214179048367, 57.077464515994826],
[-1.0202643866548367, 57.077464515994826],
[-1.0202643866548367, 57.68153528540062]]], null, false);
var img = s2.filterBounds(geometry).first()
Map.addLayer(img.select('QA60').randomVisualizer())
print(img)
var train = img.stratifiedSample({
numPoints: 10,
classBand: 'QA60'
})
print(train)
The QA60 band has a resolution of 60m/pixel but the rest of the bands in the image have lower resolution. I am not sure if this is the cause of the problem. If it is, is there a way to increase the resolution of the QA60 band to 10m/pixel?