0

Well, if I want filter to two time periods in a year. Just like 1989-01-01~1989-04-01 and 1989-10-01~1990-01-01.It is about the time series analysis. There is part of my code, something not shows under ( such as ' rmL457Cloud ' )

var landsat2 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
                        .filterDate('1987-01-01','1987-4-01')
                        .filterBounds(roi)
                        .map(rmL457Cloud)
                        .filter(ee.Filter.lte('CLOUD_COVER',5))
                        .map(scaleImage)
                        .map(NDWI)
                        .map(MNDWI)
                        .mosaic()
                        .clip(roi);
2
  • What is the error you are receiving?
    – Binx
    Mar 23, 2022 at 14:22
  • I want to filter two time periods at the same time. But I don't how to do this. Mar 23, 2022 at 14:25

1 Answer 1

4

You can use .filter(ee.Filter.or(filter1, filter2)) instead of .filterDate():

var l2 = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
          .filter(ee.Filter.or(
            ee.Filter.date('1989-01-01', '1989-04-01'),
            ee.Filter.date('1989-10-01', '1990-01-01'))
          );
          // .filterBounds()...

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.