1

I am very new to Google Earth Engine. I want to create image collections with specific images that I have pre-selected. I think that maybe I should filter by metadata properties - either date or product_ID. It's not working and I need to figure out how to do it for many images.

A basic example of what I have tried:

var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR').filterMetadata(
    'LANDSAT_ID',
    'equals',
    LT05_L1TP_225059_19840826_20170220_01_T1
);

or perhaps using system:time_start to filter by date in some way.

Green-Avocado
  • 901
  • 5
  • 20
Lola
  • 41
  • 2
  • 6

2 Answers2

2

For selecting by date:

var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
          .filterBounds(YOUR geometry)
          .filterDate('2018-08-18', '2019-08-19');

For selecting by IDs:

var l8= ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
          .filter(ee.Filter.inList('LANDSAT_ID',ee.List(['YOUR Landsat ID','YOUR Landsat ID'])));
HamiEbra
  • 310
  • 2
  • 7
  • 1
    Thank you this was useful. I also found another solution following this code https://code.earthengine.google.com/e62639c6e1b1c21c6e6ad41c0d2b6399 – Lola May 20 '20 at 03:51
0

I feel the answer provided by Lola in the comment section is much more easier. I am adding in this answer here for other's convenience.

Credits to @Lola,

Directly adding the Landsat images using the ID into an Image collection for each of the image you are interested.

var c = ee.ImageCollection([
  ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_225059_20130826'),
  ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_225059_20130911')]);
jona
  • 592
  • 1
  • 4
  • 16