2

I am trying to collect images using Sentinel-2 for the month of June, but it says no image was found.

Here is the code snippet


var s2 = ee.ImageCollection("COPERNICUS/S2_SR")

Map.centerObject(thane,12)  //ROI

var rgbVis = {
  min: 0.0,
  max: 3000,
  bands: ['B4', 'B3', 'B2'],
};

var bands = ['B2', 'B3', 'B4','B8']
 
var filtered = s2
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 10))
  .filter(ee.Filter.date('2018-06-01', '2018-06-30'))
  .filter(ee.Filter.bounds(thane))
  .select(bands)

Here is the error

Image (Error)
Image.sampleRegions: Invalid numInputs: 0.

I checked this previously asked question on stackoverflow. So I believe it is the issue with the month number. But when I changed it to '6' instead of '06', the issue remained.

How can I resolve this? Please find the code here

1 Answer 1

2

In the dataset catalog for that collection:

The Sentinel-2 L2 data are downloaded from scihub. They were computed by running sen2cor. WARNING: ESA did not produce L2 data for all L1 assets, and earlier L2 coverage is not global.

You will have to fallback to the "COPERNICUS/S2 or COPERNICUS/S2_HARMONIZED collections, which unfortunately are not surface reflectance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.