1

Is it possible to select from a collection of images for example of 30 years and ask only the image of July for each year? The below only include July images for a single year.

var aoi = ee.Geometry.Point([0, 10])
Map.addLayer(aoi)
var collection = ee.ImageCollection('COPERNICUS/S2')
  .filterBounds(aoi)
  .filterDate('2020-07-01', '2020-08-01')
2
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works. Thanks.
    – PolyGeo
    Feb 15, 2021 at 1:41
  • You can filter your collection based on day of the year with ee.Filter.calendarRange(183, 213, 'day_of_year'). Because of leap years, you don't get exact calendar month, but hopefully close enough for your use-case. code.earthengine.google.com/9e2fe3a1785ce3a676a245154c58375a Feb 16, 2021 at 10:02

1 Answer 1

1

As Daniel suggests, use ee.Filter.calendarRange() for 30 years sequence and for July filtering. You can stack .filter() functions:

var aoi = ee.Geometry.Point([0, 10])
Map.addLayer(aoi)
var collection = ee.ImageCollection('COPERNICUS/S2')
  .filterBounds(aoi)
  .filter(ee.Filter.calendarRange(1990,2020,'year'))
  .filter(ee.Filter.calendarRange(7,7,'month'));

A 30 years sequence isn't possible to obtain from S2 since it was launched in 2015

Your Answer

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

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